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

GridListControl cellType customization

Thread ID:

Created:

Updated:

Platform:

Replies:

80820 Apr 28,2009 04:01 PM UTC Sep 8,2009 11:35 AM UTC Windows Forms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On April 28, 2009 04:01 PM UTC

Hi,

I have a GridDataBoundGrid with a column CellType set to "GridListControl".

I want to customize this grid ( col width, col align, allow add new, etc).
Who I can do that?

Best regards,

Martin


Jisha Joy [Syncfusion]
Replied On April 29, 2009 06:21 AM UTC

Hi Martin,

You could handle the CurrentCellShowingDropDown event and can set the properties for ListControlPart. You can refer the grid inside the dropdown by using ListControlPart.Grid property and set the styles by handling PrepareViewStyleInfo event. Please see the code:



void gridDataBoundGrid1_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e)
{
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
if (cc.Renderer.GetType() == typeof(GridDropDownGridListControlCellRenderer))
{
GridDropDownGridListControlCellRenderer cr = (GridDropDownGridListControlCellRenderer)cc.Renderer;
cr.ListControlPart.AllowResizeColumns = true;
cr.ListControlPart.Grid.ColWidths[2] = 100;
cr.ListControlPart.Grid.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(Grid_PrepareViewStyleInfo);

}
}

void Grid_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{

if(e.ColIndex == 2)
{
e.Style.HorizontalAlignment = GridHorizontalAlignment.Right;
}


}



Please let me know if you have any questions.
Regards,
Jisha


Santosh U
Replied On July 17, 2009 04:13 PM UTC

Hi Jisha,

This is really great. Only I am not able to get the property where in I can set the dropdowngridlist control AllowNew and AllowEdit property to true.

Can you please help me.
Thanks

Jisha Joy [Syncfusion]
Replied On September 8, 2009 11:35 AM UTC

Hi Santhosh,

The properties AllowNew and AllowEdit are not available for GridListControl. If your intension is to have editable drop-down grid, then this can be achieved by having drop-down gridcontrol in cell. See the following sample from our sample browser for more information:

\My Documents\syncfusion\essentialstudio\7.3.0.20\Windows\Grid.Windows\Samples\2.0\Custom Cell Type\Drop-Down Grid Demo

Please let me know if you have any questions.

Regards,
Jisha

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

;