Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
24822 | Feb 11,2005 08:44 AM UTC | Feb 14,2005 01:07 PM UTC | WinForms | 7 |
![]() |
Tags: GridControl |
object oldValue;
protected override void OnShowDropDown()
{
oldValue = ControlValue;
base.OnShowDropDown ();
}
protected override void OnCloseDropDown(PopupCloseType reason)
{
base.OnCloseDropDown (reason);
string s = ControlText;
if (s == "Item3" || s == "Item4")
{
; // accept entry
}
else
{
ControlValue = oldValue;
}
}
public override bool ValidateString(string s)
{
if (s == "Item3" || s == "Item4")
{
// accept entry
}
else
return false;
return base.ValidateString(s);
}
>Hi,
>
>I have a combo in one of the cells in the grid (unbound).
>
>I want to limit the selectable items to only those that satisfy a condition.
>
>The items in the combo look something like this:
>
>Item 1
> Item 2
> Item 3
> Item 4
> Item 5
> Item 6
> Item 7
>
>In this example I''d only like Item 3, 4, 6 and 7 to be selectable.
>
>Thanks,
>
>Nick
> object oldValue;
> protected override void OnShowDropDown()
> {
> oldValue = ControlValue;
> base.OnShowDropDown ();
> }
>
> protected override void OnCloseDropDown(PopupCloseType reason)
> {
> base.OnCloseDropDown (reason);
> string s = ControlText;
> if (s == "Item3" || s == "Item4")
> {
> ; // accept entry
> }
> else
> {
> ControlValue = oldValue;
> }
> }
>
> public override bool ValidateString(string s)
> {
> if (s == "Item3" || s == "Item4")
> {
> // accept entry
> }
> else
> return false;
>
> return base.ValidateString(s);
> }
>
>
>
>>Hi,
>>
>>I have a combo in one of the cells in the grid (unbound).
>>
>>I want to limit the selectable items to only those that satisfy a condition.
>>
>>The items in the combo look something like this:
>>
>>Item 1
>> Item 2
>> Item 3
>> Item 4
>> Item 5
>> Item 6
>> Item 7
>>
>>In this example I''d only like Item 3, 4, 6 and 7 to be selectable.
>>
>>Thanks,
>>
>>Nick 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.
This page will automatically be redirected to the sign-in page in 10 seconds.