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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Disabling of Custom validation

Thread ID:

Created:

Updated:

Platform:

Replies:

19077 Sep 17,2004 07:41 AM UTC Sep 17,2004 11:00 AM UTC Windows Forms 6
loading
Tags: GridControl
Thiyagu
Asked On September 17, 2004 07:41 AM UTC

Hi Clay, I''m using GDBG grid.In that i''m binding an Arraylist as Datasource for drop-down cell types in a column. After selecting a value from Drop-down, when i''m leaving out of the current cell, the custom validation is getting fired and its not allowing me to come out of the cell. The Array list has got the same data as that of the column. Here, If u can tell me the way for how to disable the custom validation, it would of great help. Thanks. Thiagu.

Administrator [Syncfusion]
Replied On September 17, 2004 08:52 AM UTC

Exactly what message are you getting? You need to make sure that the type of the ValueMember in your ArrayList is the same as the type of the column in the DataSource of the grid. For example, if the grid''s DataSource holds an int in that column, the ValueMember property of the ArrayList should also be an int.

Thiyagu
Replied On September 17, 2004 09:01 AM UTC

I''m getting "Component must be Myobject Type". Here I dont want the validation to happen. Because, I''m binding an arraylist which has got a combination of Id(int) and name(string) and the column is holding only the string. The scenario is the user will get the drop-down only if he clicks on Add/Edit. By that time only I''m changing the cell type to be of combo box. So, Is there any way so that I can disable the validation of cell??.. Thiagu. >Exactly what message are you getting? > >You need to make sure that the type of the ValueMember in your ArrayList is the same as the type of the column in the DataSource of the grid. For example, if the grid''s DataSource holds an int in that column, the ValueMember property of the ArrayList should also be an int.

Administrator [Syncfusion]
Replied On September 17, 2004 09:16 AM UTC

>>Is there any way so that I can disable the validation of cell??.. The problem is if your grid''s DataSource holds a string, then the grid must have a string to assign to it. If your valuemember on the combobox is a int, then grid does not have the string to assign. And this is the problem. The validation only displays the problem. Avoiding the validation will not avoid the problem of the grid not having the proper type to assign as the grid uses the ValueMember to decide what to put into its data source. And if these two types do not match, then the grid cannot properly set the value into the datasource. So, if your grid column holds a string, and you want to have the string from the combobox set into the grid, then you might try making the displaymember and valuemember both be the string. The int value would play no role in this case. If you want to avoid the validation, you can derive the grid and override OnCurrentCellValidating, and there, do not call the baseclass. But this will not resolve the problem of the grid trying to put an int value into a string column in a datatable.

Thiyagu
Replied On September 17, 2004 09:48 AM UTC

I''m not going to save the int value in the database. I''m using the int value just for reference(While updating, I''m using this int value in the where clause). Again, I''ve tried with the arraylist which holds string alone but that also not working. Thiagu

Administrator [Syncfusion]
Replied On September 17, 2004 10:24 AM UTC

>>I''''m not going to save the int value in the database. What do you want to save in the database? Nothing? If nothing, then try handling grid.Model.SaveCellInfo. In your handler, if e.ColIndex and e.RowIndex point to one of these cells, then set e.Handled = true. This should prevent anything from being saved. If you want to save something in particular, then in SaveCellInfo, try explicitly setting e.Style.CellValue to be what you want to save when when e.ColIndex and e.RowIndex point to one of these cells, and do not set e.Handled = true. If you can post a sample project showing the problem, we can try to find a solution.

Thiyagu
Replied On September 17, 2004 11:00 AM UTC

Thanks a lot Clay. This is what I''m exactly looking for. Thanks a lot. Thiagu.

CONFIRMATION

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.

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

;