Visual Studio .NET - Using date time picker or equivalent control in Gridview control ?

Asked By Ajit Ghule
04-Jun-08 06:59 AM

How to use date time picker or any other equivalent control in Gridview control ?

Suppose i have 5 rows in my gridview control.

For all these rows i want this date time picker.so that user can select a date using this control and when i will click on insert then i want to insert this date time value to database.

Datetime picker in ASP.net gridview  Datetime picker in ASP.net gridview

04-Jun-08 07:16 AM

You can find a solution in the below articles:

http://www.codeproject.com/KB/grid/DATETIMEPICKER_GRIDVIEW.aspx

http://msdn.microsoft.com/en-us/7tas5c80.aspx

Hope this helps you a bit.. All the Best..!!

Rakesh Vikram

nice article of datetimepicker for gridview  nice article of datetimepicker for gridview

04-Jun-08 07:24 AM

This article will help u

http://www.codeproject.com/KB/grid/DATETIMEPICKER_GRIDVIEW.aspx

its nice one.

 

Gridview control reply  Gridview control reply

04-Jun-08 12:17 PM

 Write the code in the as below way

protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {....

     }

For the CheckBox column, it has already implemented in DataGridView, you can use it easily.

 

Code Snippet

 

void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)

{

CheckBox cb = e.Control as CheckBox;

if (cb != null)

{

cb.Checked = true;//false due to your business logic.

}

}

A quick search has given the following code.. hope it helps

http://www.codeproject.com/KB/grid/DATETIMEPICKER_GRIDVIEW.aspx

Try This  Try This
05-Jun-08 12:49 AM

Hi Ajit,
I think there is some way to handle this. I think you can use datetimepicker directly in gridview like any other controls. Just have a look here in this link they  have provide same thing

http://www.codeproject.com/KB/grid/DATETIMEPICKER_GRIDVIEW.aspx

Or

We can do one thing. We can create a custom control for datepicker and just add that in a column of gridview. And you can easily worked on that.
I think this is another way to solve your problem. Go thr these links whcih will give u an idea of how to impliment a datepicker in asp.net. You can easily use that in your page. So now just think of using same in your gridview. Try it.

http://www.15seconds.com/issue/040315.htm

http://www.codeproject.com/KB/aspnet/Datepickercontrol.aspx

Best Luck!!!!!!!!!!!
Sujit.

Create New Account
help
Visual Studio .net .NET Framework Hi NG, ich habe vor längerer Zeit mit Visual Studio .Net 2003 gearbeitet und überlege momentan auf einen neueren Stand upzudaten. Ein Visual Studio .Net 2008 scheint es nicht zu geben. Habe zumindest mit googeln nichts gefunden. Was
Wise for Visual Studio.NET Wise for Visual Studio.NET By Peter A. Bromberg, Ph.D. To "Print This Page" Link Peter Bromberg Wise for Visual Studio .NET is a total and complete installation development system for creating and editing Windows® Installer
Visual Studio versioning . . . . how to tell? .NET Framework To my knowledge, Visual studio 6 was released in 1998, then Visual Studio .NET 2002 is VS 7, then Visual Studio .NET 2003 is VS 7.1, then Visual
visual studio.net 2003 and Access 2007 database .NET Framework Hi I am currently using Visual Studio.Net 2003 running on Windows Server 2000 operating system. I have used Visual Studio.net 2003 connecting to Access 2002 databases in the pass with great success. Now
Is Visual Studio self-hosting ? .NET Framework Does Microsoft use Visual Studio IDE, Visual Studio Debugger, Visual Studio Linker and Visual Studio compiler for developing Visual Studio ? Or is Visual Studio not