GGC - How do I leave 1 checkbox checked?

Hi!

I have one GGC on my windows form, and exists one column from type CheckBox with various rows. How do I make to only one CheckBox is checked on the grid?

Thanks!

Ediberto

7 Replies

AD Administrator Syncfusion Team August 14, 2009 02:48 PM UTC

Up!


AM Adriano Martins Junqueira August 17, 2009 05:11 PM UTC

Up!


AD Administrator Syncfusion Team August 19, 2009 01:44 PM UTC

can anyone help me please?


LS Lingaraj S Syncfusion Team August 20, 2009 03:16 PM UTC

Hi Ediberto,

Sorry for the delayed response.

Please try using TableControlCheckBoxClick and RecordValueChanged changed events with conditional statements to achieve your functionality.

Refer the sample from below link:
http://files.syncfusion.com/support/samples/Grid.Windows/7.3.0.20/Forums/GGCCheck.zip

Please let me know if you have any queries.

Regards,
Lingaraj S.


AD Administrator Syncfusion Team August 24, 2009 03:01 PM UTC

Hi Lingaraj

I downloaded your sample but occurs an error while I runs:

'Syncfusion.Grouping.Record' does not contain a definition for 'GetRowIndex' and no extension method 'GetRowIndex' accepting a first argument of type 'Syncfusion.Grouping.Record' could be found (are you missing a using directive or an assembly reference?)

Can you help me?

I´m using the version 6.3.0.30

Thanks


AD Administrator Syncfusion Team August 25, 2009 08:35 PM UTC

Hi Lingaraj,
I solved this problem using the GetSourceIndex() method:

int row = e.Record.GetSourceIndex();

I have a second question.
How do I do mark the checkbox, unmarking the other checkbox when I click other row from other column Value from the example?

Thanks

Ediberto


LS Lingaraj S Syncfusion Team August 26, 2009 12:41 PM UTC

Hi Ediberto,

Thank you for the update.

Please try using CurrentRecord in conditional statement to achive your behavior.

Refer the modified code below:

// Modified RecordValueChanged event
void Table_RecordValueChanged(object sender, RecordValueChangedEventArgs e)
{
if (e.FieldDescriptor.Name =="Value")
{
if (!changing)
{
changing = true;
foreach (Record rec in e.Record.ParentTable.Records)
{
if(rec!=e.Record.ParentTable.CurrentRecord)
rec.SetValue("Value", 0);
}
changing = false;
}
}
}


Please let me know if you have any queries.

Regards,
Lingaraj S

Loader.
Up arrow icon