Ticket Q477718
Visible to All Users

Unbound checkbox column in grid

created 12 years ago

Hi,

I want to have a column in my grid that contains a checkbox that is unbound for each row in my grid. The only article I found on how to do this is 9 years old. How can I achieve this result?

I've added a grid and I have added a column that is unbound and the unbound datatype is set to boolean. This does put the checkbox column in the grid but when I check the checkbox for one row and then go to check the box for another row, the first row I checked becomes unchecked. I would like to check multiple rows so that when my save routine runs, I will look at the checked rows and save them to the database.

Thanks for any examples or advice.

Greg

Answers approved by DevExpress Support

created 12 years ago (modified 12 years ago)

Thank you for reaching out to our team, Greg.
The values of the custom unbound column must be stored and retrieved manually when GridView.CustomUnboundColumnData is fired (for e.IsSetData and e.IsGetData respectively). Please see my attached sample for one possible implementation of this approach.
In my sample, I'm making use of a collection which supports collection change notifications to also allow for the New Item Row functionality. This is unrelated to working with an unbound column.
Please feel free to let me know if you have any questions or concerns with this approach.

    Show previous comments (8)
    DevExpress Support Team 12 years ago

      Hi Greg,
      I am glad that you resolved the problem. Feel free contact us in the future.

        In theRepositoryItem.EditValueChanging event handler how can i call the custom draw header event so that the header checkbox will be checked and unchecked accordingly.

        DevExpress Support Team 10 years ago

          Hello,
          You can use the GridView.InvalidateColumnHeader method for this purpose. Please try it and let me know whether it helps.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.