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

Stop GridDataBoundGrid from showing DateTimePicker

Thread ID:

Created:

Updated:

Platform:

Replies:

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

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 11:30 AM UTC

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 06:48 PM UTC

Hi Haneef,

It doesn't work.

Regards,
Andrey

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


how do you do this in a grid grouping control

>Hi Haneef,

It doesn't work.

Regards,
Andrey

Administrator [Syncfusion]
Replied On November 2, 2006 03:45 AM UTC

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 12:29 PM UTC

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 6, 2006 04:46 AM UTC

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 09:00 AM UTC

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.

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

;