locked
using controls in gridView RRS feed

  • Question

  • User1085154155 posted

    How we could use textBox in a GridView ?

    I want to insert a UserControl also ?

    any immidiet answer could be helpful

    Sunday, September 18, 2011 12:22 PM

Answers

  • User3866881 posted

    How we could use textBox in a GridView ?

    Hello:)

    Just click the small arrow of the GridView, you can get a Wizard for which DataSource do you want for the GridView, and then follow to auto generate the Insert, Update or Delete method.

    You can see there's an "Edit" Item, so when you run the program and click "Edit"—— The GridView will turn into the Edit mode, where you can see TextBox there for you to edit the column's values to be updated with.

    See a torturial of an Editable GridView at: http://csharpdotnetfreak.blogspot.com/2009/05/gridview-sqldatasource-insert-edit.html

    I want to insert a UserControl also ?

    Yes you can!

    Just convert a column into a Template mode, and then do to add your usercontrol there, use it as normal.

    For a simple demo:

    http://www.c-sharpcorner.com/UploadFile/LivMic/UC_InsideGV02202007133624PM/UC_InsideGV.aspx

    Thx again

     

     

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 19, 2011 9:34 PM
  • User-665004399 posted

    hi,

    You can insert controls using

    <itemTemplate>

    if you ant the control in edit mode then place the control in <edititemtemplate>

    Refer the below links

    http://www.codeproject.com/KB/dotnet/AccessingControlsInsideGr.aspx

    http://geekswithblogs.net/casualjim/articles/51360.aspx

    http://geekswithblogs.net/casualjim/archive/2006/05/04/77151.aspx

    http://geekswithblogs.net/AzamSharp/archive/2005/10/05/56183.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 19, 2011 11:57 PM

All replies

  • User3866881 posted

    How we could use textBox in a GridView ?

    Hello:)

    Just click the small arrow of the GridView, you can get a Wizard for which DataSource do you want for the GridView, and then follow to auto generate the Insert, Update or Delete method.

    You can see there's an "Edit" Item, so when you run the program and click "Edit"—— The GridView will turn into the Edit mode, where you can see TextBox there for you to edit the column's values to be updated with.

    See a torturial of an Editable GridView at: http://csharpdotnetfreak.blogspot.com/2009/05/gridview-sqldatasource-insert-edit.html

    I want to insert a UserControl also ?

    Yes you can!

    Just convert a column into a Template mode, and then do to add your usercontrol there, use it as normal.

    For a simple demo:

    http://www.c-sharpcorner.com/UploadFile/LivMic/UC_InsideGV02202007133624PM/UC_InsideGV.aspx

    Thx again

     

     

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 19, 2011 9:34 PM
  • User-665004399 posted

    hi,

    You can insert controls using

    <itemTemplate>

    if you ant the control in edit mode then place the control in <edititemtemplate>

    Refer the below links

    http://www.codeproject.com/KB/dotnet/AccessingControlsInsideGr.aspx

    http://geekswithblogs.net/casualjim/articles/51360.aspx

    http://geekswithblogs.net/casualjim/archive/2006/05/04/77151.aspx

    http://geekswithblogs.net/AzamSharp/archive/2005/10/05/56183.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 19, 2011 11:57 PM