AD
Administrator
Syncfusion Team
May 10, 2006 01:08 PM UTC
Hi Cheryl,
You need to handle the QueryCellStyleInfo event to enable/disable the record in a groupingrid.Here is a code snippet.
Record r = e.TableCellIdentity.DisplayElement.ParentRecord;
if( r != null)
{
object obj = r.GetValue("Check"); //Check is the name of the unbound check box column
if( obj != null && obj.ToString() != string.Empty)
{
int checkValue = (int)obj;
if( checkValue == 1)
{
e.Style.Enabled = true;
}
else
e.Style.Enabled = false;
}
}
Please let me know if this helps.
Thanks for your interest in Syncfusion Products.
Best Regards,
Haneef
CH
cheryl
May 11, 2006 06:25 AM UTC
hello haneef
I''ll rephrase the question
if a column from datasource has a value of 1 the unbound checkbox column for that record should be checked on form load and if it''''s 0 it should be unchecked ...... What could the solution be ?
Thanx
>Hi Cheryl,
>
>You need to handle the QueryCellStyleInfo event to enable/disable the record in a groupingrid.Here is a code snippet.
>
>Record r = e.TableCellIdentity.DisplayElement.ParentRecord;
>if( r != null)
>{
> object obj = r.GetValue("Check"); //Check is the name of the unbound check box column
> if( obj != null && obj.ToString() != string.Empty)
> {
> int checkValue = (int)obj;
> if( checkValue == 1)
> {
> e.Style.Enabled = true;
> }
> else
> e.Style.Enabled = false;
>
> }
>}
>
>Please let me know if this helps.
>
>Thanks for your interest in Syncfusion Products.
>Best Regards,
>Haneef
>
>
AD
Administrator
Syncfusion Team
May 11, 2006 09:33 AM UTC
Hi Cheryl
Through the Record.GetValue() method the value of the record can be retrieved. Here is a small sample which gets the value from a bound column(from Datasource) in a grid (the column name is ''value'') and changes the value of the unboundcheckbox column (the column name is ''CheckBox'' ) in a grid. In the QueryCellStyleInfo event, the record''s value is retrieved as an object(o). With the object, the value of the unboundcheckbox column is changed through Record.SetValue() method. The code for the QueryCellStyleInfo event is as follows.
Record r = e.TableCellIdentity.DisplayElement.ParentRecord;
if( r != null)
{
object obj = r.GetValue("Value");
if( obj != null && obj.ToString() != string.Empty)
{
int checkValue = (int)obj;
if( checkValue == 1)
{
r.SetValue("CheckBox","True");//Set the value of unbound column;
}
else
r.SetValue("CheckBox","False");//Set the value of unbound column
}
}
Here is a sample.
http://www.syncfusion.com/Support/user/uploads/UnboundCheckboxGridGroup_CS_b9ba14f1.zip
Please let me know if i am missing something.
Thanks for your interest in Syncfusion Products.
Best Regards,
Haneef
CH
cheryl
May 12, 2006 06:47 AM UTC
hello haneef it''s working perfectly .......... thanx a lot
>Hi Cheryl
>
>Through the Record.GetValue() method the value of the record can be retrieved. Here is a small sample which gets the value from a bound column(from Datasource) in a grid (the column name is ''value'') and changes the value of the unboundcheckbox column (the column name is ''CheckBox'' ) in a grid. In the QueryCellStyleInfo event, the record''s value is retrieved as an object(o). With the object, the value of the unboundcheckbox column is changed through Record.SetValue() method. The code for the QueryCellStyleInfo event is as follows.
>
>Record r = e.TableCellIdentity.DisplayElement.ParentRecord;
>if( r != null)
>{
> object obj = r.GetValue("Value");
> if( obj != null && obj.ToString() != string.Empty)
> {
> int checkValue = (int)obj;
> if( checkValue == 1)
> {
> r.SetValue("CheckBox","True");//Set the value of unbound column;
> }
> else
> r.SetValue("CheckBox","False");//Set the value of unbound column
> }
>}
>
>Here is a sample.
>http://www.syncfusion.com/Support/user/uploads/UnboundCheckboxGridGroup_CS_b9ba14f1.zip
>
>Please let me know if i am missing something.
>
>Thanks for your interest in Syncfusion Products.
>Best Regards,
>Haneef