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. Image for the cookie policy date
close icon

Grid formating problem

Hi all,

we are using the grid to display dynamic data returned from database with datasets. After having trouble to get the foreignkeys to display as combobox in edit-mode (relation is manually added via code), we have one minor problem left:

Where can we format the controls used in edit mode? Text-align of edit boxes, color of the datetime picker and mainly the grid displaying the foreign key relationship? Is there a way to style these controls? We are NOT using autoformat.

Thanks for your help :-)

5 Replies

RP Rekha P Syncfusion Team November 4, 2009 12:30 PM UTC

Hi Martin,

Thank you for your interest in Syncfusion Products.

Yes, this is possible to disable the inline textboxes when the Grid is in edit mode. This can be achieved using RowDataBound event handler which will bound for each grid row. Please refer the simple code snippet below to achieve this for AddNew record row.

void GridGroupingControl1_RowDataBound(object sender, RowDataBoundEventArgs e)
{
//// Gets the Current Record Row Element Bound.
if (e.Element.Kind == DisplayElementKind.AddNewRecord)
{
for (int i = 0; i < e.Row.Cells.Count; i++)
{
/////// Check for column name.
//if (((Syncfusion.Web.UI.WebControls.Grid.Grouping.GridCell)(e.Row.Cells[i])).ColumnDescriptor.Name == "Name")
//{
TextBox txtbox = null;
foreach (Control ctrl in e.Row.Cells[i].Controls)
{
if (ctrl is TextBox)
{
txtbox = ctrl as TextBox;
txtbox.Enabled = false;
break;
}
}
//}
}
}
}

http://files.syncfusion.com/support/GGC.Web/7.3.0.20/60272/main.htm

Please try removing AutoFormat to none from the above sample and let me know if you have any concerns.

Thanks,
Rekha


MK Martin Kappl November 11, 2009 10:17 AM UTC

Thanks for your answer. I will try this asap and give you feedback about it.


GM Gowri Manohari D Syncfusion Team November 12, 2009 03:39 AM UTC

Hi Martin,

Thank you for the update.

Regards,
Gowri


MK Martin Kappl November 20, 2009 10:57 AM UTC

I checked it and it works, but one little problem stays open.

I use this code to format the dropdown:

Dim objDropDown As MultiColumnDropDownCombo = CType(objCell.Controls(0), MultiColumnDropDownCombo)

objDropDown.AutoFormat = "none"
objDropDown.ButtonCssClass = "SFDropDownButton"
objDropDown.ButtonHoverCssClass = "SFDropDownButton"
objDropDown.ContainerHoverCSSClass = "SFDropDownContainer"
objDropDown.ContainerTableCssClass = "SFDropDownContainer"
objDropDown.ControlRootCSSClass = "SFDropDownDefault"
objDropDown.PopupCssClass = "SFDropDownPopup"
objDropDown.TextBoxCssClass = "SFDropDownTextBox"
objDropDown.TextBoxHoverCssClass = "SFDropDownTextBox"
objDropDown.HeaderStyle.CssClass = "SFDropDownHeaderStyle"
objDropDown.ItemStyle.CssClass = "SFDropDownItemStyle"
objDropDown.HoverItemStyle.CssClass = "SFDropDownItemStyleHover"
objDropDown.ShowHeader = False
objDropDown.PopupHeight = 200
objDropDown.Columns(1).ItemStyle.CssClass = "SFDropDownItemStyle"
objDropDown.Columns(1).ItemStyle.Width = 200

Everything works, except the "HoverItemStyle". There is no property for it at the boundcolumn und the setting at dropdown level does not make any effect.


GM Gowri Manohari D Syncfusion Team November 24, 2009 04:54 AM UTC

Hi Martin,

Please send me the sample which you have used for this issue. It will be useful to proceed further.

Regards,
Gowri

Loader.
Live Chat Icon For mobile
Up arrow icon