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.

Stop GridDataBoundGrid from showing DateTimePicker

Thread ID:

Created:

Updated:

Platform:

Replies:

51252 Nov 1,2006 05:32 AM Nov 6,2006 04:00 AM Windows Forms 7
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On November 1, 2006 05:32 AM

When I assign a data source which has DateTime fields to a GridDataBoundGrid, it always shows DateTimePicker in the corersponding columns. How do I disable that? I want just plain DateTime converted to string. Thanks!

Administrator [Syncfusion]
Replied On November 1, 2006 06:30 AM

Hi Andrey,

Please try changing the cell type to textbox and set the format to include the both date and time.

//format column so no dropdown
GridStyleInfo style = this.gridDataBoundGrid1.Binder.InternalColumns[0].StyleInfo;
style.CellType = "TextBox";
style.CellValueType = typeof(DateTime);
style.Format = "MM/dd/yy HH:mm:ss:fff";

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On November 1, 2006 01:48 PM

Hi Haneef,

It doesn't work.

Regards,
Andrey

Administrator [Syncfusion]
Replied On November 1, 2006 06:57 PM


how do you do this in a grid grouping control

>Hi Haneef,

It doesn't work.

Regards,
Andrey

Administrator [Syncfusion]
Replied On November 1, 2006 10:45 PM

Hi Andrey ,

Try this code snippet to change the celltype of the cell in a grid. Here is a code snippet

//For maintable...
this.grid.TableDescriptor.Columns["ColumnName"].Appearance.AnyRecordFieldCell.CellType = "TextBox";

//For NestedTable.
this.grid.GetTableDescriptor("TableName").Columns["ColumnName"].Appearance.AnyRecordFieldCell.CellType = "TextBox";

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On November 3, 2006 07:29 AM

Hello,

1) I am talking about GridDataBoundGrid, not about some "grid grouping control"...

2) Haneef, GridDataBoundGrid does not have the "TableDescriptor" property...

3) If you really want to help, please try testing your solutions before suggesting.

Thank you.

Administrator [Syncfusion]
Replied On November 5, 2006 11:46 PM

Hi Andrey,

My sincere appologies for the inconvenience caused. The attached sample shows you how to change the appearance of the DateTime column cells in a grid. Please try it and let me know if you are trying something different.

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/AppearanceDateTimeColumn_bb17bdc3.zip

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On November 6, 2006 04:00 AM

Hi Haneef,

Thanks for your help, it worked! I must have been doing something wrong when you suggested this solution first time, sorry :)

Thanks again!

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.

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.

;