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

Unable to add CheckBox to First Column in GDBGTreeLines Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

72727 Apr 2,2008 12:41 PM UTC Apr 11,2008 09:40 AM UTC Windows Forms 9
loading
Tags: GridControl
Raul
Asked On April 2, 2008 12:41 PM UTC

Hi,

I would like to add a checkbox to the first column in GDGBG Tree lines Grid.
I am appending a small dummy sample in which I was trying add a checkbox to the first column.
Checkbox will work for any column index except the first one.

Thanks,
Raul Dsouza



SyncGrid.zip

Administrator [Syncfusion]
Replied On April 2, 2008 11:59 PM UTC

Hi Raul,

Thank you for your interest in Syncfusion products.

To Solve this issue You need to handle QueryCellInfo event to set the CellType of the first column as checkbox and QueryColWidth to set the width of the first column. Please refer the code below for more details.

void Model_QueryColWidth(object sender, GridRowColSizeEventArgs e)
{
if (e.Index == 1)
{
e.Handled = true;
e.Size = 20;
}
}

void dgrd_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
if (e.ColIndex == 1)
{
Console.WriteLine(e.Style.CellType);
e.Style.CellType = "CheckBox";
e.Style.CellValue = true;
}

}


Here is the modified sample that implements this task.
http://websamples.syncfusion.com/samples/Grid.Windows/F72727/main.htm

Please let me know if this helps.

Best Regards,
Srirajan



Raul D''souza
Replied On April 3, 2008 06:45 AM UTC

I tried using the code appended by you...still I do not get the desrired checkbox in the first column.

Also I downloaded the web samples (SyncGrid.zip) that was appended, that too didn;t contain the checkbox in the first column.

Raul D'souza


Administrator [Syncfusion]
Replied On April 4, 2008 01:21 AM UTC

Hi Raul,

Sorry for the inconvenience caused. Here is the modified sample that implements this task.
http://websamples.syncfusion.com/samples/Grid.Windows/I72727Apr04/main.htm

Please let me know if you have any further questions.

Best Regards,
Srirajan



Raul
Replied On April 7, 2008 07:37 AM UTC

Hi,

Now the checkBox column shows, however

1> The one highlighted in red, does not check , uncheck upon clicking it.

2>The other checkbox column thorws an exception "Column 'Key" is constrained to be unique. Value 'True" is already Present" when I try to check all the three columns.

--Raul


Administrator [Syncfusion]
Replied On April 8, 2008 12:28 AM UTC

Hi Raul,

Here is the modified sample which solves this issue.

http://websamples.syncfusion.com/samples/Grid.Windows/I72727Apr08/main.htm

Please let me know if this helps.

Best Regards,
Srirajan



Raul
Replied On April 8, 2008 06:27 AM UTC

Now yr sample does not show any checkbox only...and also on clicking on the Plus (collapsed) sign...the sign remains Plus.

Kindly verify the results before posting it.

--Raul


Raul
Replied On April 10, 2008 07:39 AM UTC

Could I recieve a reply for this question please.


Sri Rajan [Syncfusion]
Replied On April 10, 2008 03:27 PM UTC

Hi Raul,

Sorry for the inconvenience caused. I am not sure what might causing this strange behaviour in your system. The attached sample works perfectly in my system. Here is the video clip that show this issue.
VideoClip

Sample:
http://websamples.syncfusion.com/samples/Grid.Windows/I72727Apr08/main.htm

Please let me know if you have any further questions.

Best Regards,
Srirajan



Raul
Replied On April 11, 2008 09:40 AM UTC

Hi,

Thanks for yr reply, I am using Syncfusion Version 4.4.0.51 and VS 2005.
Do I need to upgrade my Syncfusion version.
Also could you let me know the cause of the problem.

Thanks,
Raul


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

;