This is a migrated thread and some comments may be shown as answers.

GridDropDownColumn case insensitive selectedvalue

3 Answers 246 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tom Langeslag
Top achievements
Rank 1
Tom Langeslag asked on 31 Mar 2010, 12:56 PM
Hi,

I am using a GridDropDownColumn and in some cases it cannot match the selected item with the list because of the case sensitive search.
On the RadComboBox there is a field iscasesensitive, i do not see this setting on the GridDropDownColumn.
Is there another way to do this, perhaps by overruling the compare in some way?

Tom

3 Answers, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 06 Apr 2010, 10:39 AM
Hello Tom,

On the Radgrid.ItemDataBound event handler you could get the RadComboBox control from the GridDropDownColumn and set its IsCaseSensitive property. Then you could match the selected item with the RadComboBox list items:
<telerik:GridDropDownColumn HeaderText="HeaderText" DataField="DataField"
 ListTextField="TextField" ListValueField="ValueField" UniqueName="UniqueName1">
</telerik:GridDropDownColumn>
void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item.IsInEditMode)
    {
       GridDataItem item = e.Item as GridDataItem;
       RadComboBox combo = item["UniqueName1"].Controls[0] as RadComboBox;
       combo.IsCaseSensitive = false;
    }
}

I hope this helps.

All the best,
Radoslav
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Tom Langeslag
Top achievements
Rank 1
answered on 06 Apr 2010, 12:52 PM
Hi Radoslav,

Thank you for the reply.
I have looked at ur code sample but this would only for editmode. I would like to know if there is a way to do this when only viewing.

Right now when viewing it will show the default value while it should be able to match (case insensitive).
When debugging in viewing mode the field is basically seen as a textbox.

Is there a way to make this work for viewing mode too?

Tom
0
Radoslav
Telerik team
answered on 09 Apr 2010, 08:14 AM
Hi Tom,

I am sending you a simple example which demonstrates using of the GridDropDownColumn. Please check it out and let me know what differs in your case. Also I could not reproduce the described scenario in which the GridDropDownColumn in view mode selects the default value. Could you please send us a simple running project with which we can reproduce the issue. You could open a formal support ticket from your Telerik account and attach a ZIP file there. In that way we can reproduce and pinpoint the problems you're facing on our side, understand the logic of your application and provide a solution.

Best wishes,
Radoslav
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Tom Langeslag
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Tom Langeslag
Top achievements
Rank 1
Share this question
or