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
close icon

Problem with QueryCellInfo Event

Hi, In my GridDataBoundGrid,I have a Column of cell type "ComboBox".I want to make next Column ReadOnly/ Read-write by giving a value based on the SelectedValue of the Combo box.Fo this Im using QueryCellInfo Event.Its just like Table creation form in SQSL Server thru Enterprise Manager.When DataType is Selected, the corresponding Length will be populated automatically.This is working fine but the problem is if user selects Varchar in dataType im showing 50 as Length by default.but i must allow him to change the Length.But when 50 is changed to some other value and moving to next column its again calling QuerycellInfo Event Handler and restting the value to 50.How can i solve this Problem.Please help. Regards, Jitendra.

4 Replies

AD Administrator Syncfusion Team March 22, 2005 12:12 PM UTC

Are you also handling grid.Model.SaveCellInfo to save this value into something (some kind of data cache)? And then in QueryCellInfo, are you retrieving this value from the cache you used in saveCellInfo? If not, then QueryCellInfo will always provide the fixed value (and not the changed value). If you want it to change, then you have to handle both QueryCellInfo and SaveCellInfo.


JI Jitendra March 22, 2005 01:00 PM UTC

Hi Im not using SaveCellInfo.Shall I need to store the value in a variable and then use tht in querycellInfo? >Are you also handling grid.Model.SaveCellInfo to save this value into something (some kind of data cache)? And then in QueryCellInfo, are you retrieving this value from the cache you used in saveCellInfo? > >If not, then QueryCellInfo will always provide the fixed value (and not the changed value). If you want it to change, then you have to handle both QueryCellInfo and SaveCellInfo.


JI Jitendra March 22, 2005 01:14 PM UTC

hi, It has problem like: If in First Row Varchar is selected im showing 50 as Length.if he chages tht and set it as 100.In SaveCellInfo im storing this in a varable.And in QueryCellInfo im using tht.Its accepting the 100 as Length but the problem is, When he moves to next row and selects Varchar againg it shows 100 as Length.How to handle this. >Are you also handling grid.Model.SaveCellInfo to save this value into something (some kind of data cache)? And then in QueryCellInfo, are you retrieving this value from the cache you used in saveCellInfo? > >If not, then QueryCellInfo will always provide the fixed value (and not the changed value). If you want it to change, then you have to handle both QueryCellInfo and SaveCellInfo.


AD Administrator Syncfusion Team March 22, 2005 01:23 PM UTC

You have to save the value for each row in SaveCellInfo, and provide that saved value for the row in QueryCellInfo. Maybe you need an array or arraylist, and save the value in SaveCellInfo using the e.RowIndex to pick out the place in teh array to save it. Then in QueryCellInfo, you retrieve the saved value from the array using e.RowIndex as well.

Loader.
Live Chat Icon For mobile
Up arrow icon