We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Dynamically Adjust Row Height Of DataGrid

I really enjoy this site and find it extremely useful in my work. Ok, my problem is that I have a DataGrid with many records (rows). I want some rows to be height 'X' some rows to be height 'Y' etc. How do I do this? From my experience PreferedRowHeight adjusts the hieght of all rows in the DataGrid, but I want to specify the height of each individual row. Thanks so much in advance! You guys are the best!

4 Replies

P P August 1, 2002 09:49 AM UTC

Dude you are really NOT reading through the rest of the posted messages.Read, that might help you!


P P August 1, 2002 01:48 PM UTC

Here is the solution anyway. Make a DataView and assign table to it. Set the data grid source to the DataView. Now use DataView.RowFilter


AD Administrator Syncfusion Team August 5, 2002 01:06 AM UTC

Dude, I bet you get bonus points in the customer service department! > Dude you are really NOT reading through the rest of the posted messages.Read, that might help you!


KF Konrad Ferguson August 9, 2002 03:08 AM UTC

Thanks for trying to help (though you were frustrated at the time, but it's okay); however, I don't think this is what I need. I did read the other messages, such as: 1.) Syncfusion Forums Home >> Windows Forms FAQ >> Subject: resize datagrid rows programatically By george harig at 5/10/2002 11:35:29 AM I need to resize the rows of a datagrid. The method I am using now is to clear the table style, set the prefered row size then add (re-add)the table style. Is there a better way? Thank you George Harig By Clay Burch at 5/13/2002 1:36:49 AM I don't know of a different way to do this. Evidently, the row height is set during databinding, and then again when a tablestyle is applied, and there appears to be no way to get at row heights at other times. Microsoft Engineer Lion Shi made this comment in a news group posting in response to a question about how to programmatically resize a row. "We cannot customize the properties of a specific row pragmatically. At this point, there is no way to work around this design limitation." Of course, there are commercial grids, such as Syncfusion's Essential Grid, where you can resize individual rows at any time. ******* As well as: 2.) Syncfusion Forums Home >> Windows Forms FAQ >> Subject: DB Grid - Hide a row depending upon contents of a cell? By Peter at 7/25/2002 6:48:49 AM Hi Clay, Thank you for your previous responces. Please if you can help with this. How do I loop through all rows in my DBGrid and hide some of them or change their Hight=0 depending upon the contents of a cell? Thank you. By Clay Burch at 7/27/2002 3:04:43 AM I don't know of a way to programatically set the height of a row. You could possibly do this using the Filter property on a DataView, and bind your datagrid to this filtered Dataview when you want the rows gone, and then rebind it to the full table when you want them to show... **** None of these messages help me adjust the height of a row programatically. Clay said, "I don't know of a way to programatically set the height of a row", so I decided to ask if anyone else did. Now, I'm only a college student learning this stuff (for a program I'm doing with my friend) when I'm not out with friends or studing for my summer school class, so I most likely do not know as much as you. I can totally understand that you may have been angry because it appeared I did not read the other posts, so it's ok. Anyways, could you tell me how to use RowFilter to change the height of a row. I only see its use in filtering rows, but not in changing the row height (I've read the Microsoft documentation - am I missing something?). Thanks a lot, Konrad > Here is the solution anyway. > Make a DataView and assign table to it. Set the data grid source to the DataView. Now use DataView.RowFilter >

Loader.
Live Chat Icon For mobile
Up arrow icon