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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Strange Problems while editing the cells

Thread ID:





31946 Jul 19,2005 06:08 AM UTC Jul 19,2005 07:46 AM UTC WinForms 2
Tags: GridControl
Asked On July 19, 2005 06:08 AM UTC

Hi, I am using GridDataBoundGrid and binding the datasource with it. I am attaching few editable columns with it like a Text Box, ComboBox and Checkbox. Strange thing I am facing is that these cells in the grid are not easily editable. I have set ReadOnly property of these columns as false. And my IgnoreReadOnly of gird is false. I tried to make a workaround for the problem hence I captured CurrentCellChanged and CurrentCellChanging events. And put following code. if(fillGrid.CurrentCell.Model.Description != "CheckBox") fillGrid[fillGrid.CurrentCell.RowIndex, fillGrid.CurrentCell.ColIndex].Text = fillGrid.CurrentCell.Renderer.ControlText; Basically if cell is checkbox then control text does not capture its new value. Hence by putting this workaround problem is improved but not to extent that I can deliver this product. Still following things are noticed. 1) Click on the Cell A. Try to change something, if it is a checkbox or combobox nothing happens, currentCellChanging event is fired no matter how many times I tried to edit the cell. if it is a textbox then first time currentCellChanging is fired and after that currentCellChanged is fired hence data is getting modified (because of replacing the cell''s text with control text) but only if I put break point, otherwise only one letter is modified after that it does not allow to edit. I know I might not make senese at this point :( 2)If I click on someother cell in "same row" and again click on original cell then CurrectCellChanged event is fired and i am able to change value in textbox, checkbox and combobox (because of my code) And if I click on some other cell in except one in "same row" then only currentCellChanging is fired and value is not modified (even with my code as controltext does not have new value). Can someone please guide me about what to check on my grid? Regards Avnish

Replied On July 19, 2005 06:15 AM UTC

I also tried to capture otherevents like CurrentCellEditingComplete and also try to call functions like EndInit(), confirmChanges(true). But nothing helps.. I am wondering there is something related to grid property which will solve this problem. Regards Avnish

Administrator [Syncfusion]
Replied On July 19, 2005 07:46 AM UTC

>>I am using GridDataBoundGrid and binding the datasource with it. I am attaching few editable columns with it like a Text Box, ComboBox and Checkbox. Strange thing I am facing is that these cells in the grid are not easily editable. For the TextBox''s, if you do nothing (handle no events, set no properties, etc), the textbox columns should be editable provided the datasource you are using supports editing. This is the simplest thing to check and get working. You should remove all event handlers and properties until this works properly. For the combobox column, you need to set the GridBoundColumn.StyleInfo.CellType property, and also the DataSource, Displaymember and ValueMember properties (if you are using a foriegn key loopup to provide the information for teh combobox). The thing to check here is the type of the valuemember. The type of the values in your grid''s datasource should be the type of the values in the foreign key datasource valuemember column. If this is set up consistently, and if your grid''s datasource allows editing, then this combobox column should be editable. Now the checkbox column is a little different. The checkbox column will never have an active state. There is no control sitting in the cell (like a combobox or a textbox). The other thing is to take into consideration is what is the type of the values in your grid datasource for this checkbox column? Are they bool''s true and false values, are they integer 0 and 1''s, are they string Yes and No, or something else. Most of the time when checkboxes do not work, the reason is some inconsistency about what the grid is expecting for the values and what the datatsource is proving for the values. So, in addition to setting style.CellType = "CheckBox", should also set style.CheckBoxOptions so the grid will understand what to except. (You may also need to set style.CellValueType as well though this is normally set by the grid directly from the type of teh data). So, if you are using bool values, you would set: gridBoundColumn1.StyleInfo.CellType = "CheckBox"; gridBoundCOlumn1.StyleInfo.CheckBoxOptions = new CheckBoxInfo(true.ToString(), false.ToString(), "", true); If you have integer 1 and 0''s, you would use: gridBoundCOlumn1.StyleInfo.CheckBoxOptions = new CheckBoxInfo("1", "0", "", ture);


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon