Click here to Skip to main content
15,920,896 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Http to Https Redirection Problem Pin
N a v a n e e t h8-May-07 23:07
N a v a n e e t h8-May-07 23:07 
QuestionHow to limit the length of TextBox when TextMode is Multiline Pin
ravi_chandra8-May-07 18:32
ravi_chandra8-May-07 18:32 
AnswerRe: How to limit the length of TextBox when TextMode is Multiline Pin
Sherin Iranimose8-May-07 19:12
Sherin Iranimose8-May-07 19:12 
Questionhow to make invisible comboBox visible in GridView Pin
AaronNeo8-May-07 18:11
AaronNeo8-May-07 18:11 
AnswerRe: how to make invisible comboBox visible in GridView Pin
Sathesh Sakthivel8-May-07 18:17
Sathesh Sakthivel8-May-07 18:17 
AnswerRe: how to make invisible comboBox visible in GridView Pin
Sherin Iranimose8-May-07 18:22
Sherin Iranimose8-May-07 18:22 
GeneralRe: how to make invisible comboBox visible in GridView Pin
AaronNeo8-May-07 22:58
AaronNeo8-May-07 22:58 
GeneralRe: how to make invisible comboBox visible in GridView [modified] Pin
Sherin Iranimose8-May-07 23:43
Sherin Iranimose8-May-07 23:43 
hi,

For make editing using gridview you should do following things.

1. Enable AutogenerateEditButton property of 'gridview' to true
2. Add Dropdownlist in to 'Item template' of 'gridview'

///

<asp:DropDownList ID="DropDownList1" runat="server" Width="126px"
DataSourceID="SqlDataSource1" DataTextField="Field2"
DataValueField="Field1" SelectedValue='<%# Bind("Field1") %>'>
</asp:DropDownList>

///

3. Add Dropdownlist in to 'Edit item template' of 'gridview'
/////

<asp:DropDownList ID="DropDownList2" runat="server" Width="126px"
DataSourceID="SqlDataSource1" DataTextField="Field2"
DataValueField="Field1" SelectedValue='<%# Bind("Field1") %>'>
</asp:DropDownList>

/////

4. Add an sqldatasource to your form
////

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="server=yourserver;Integrated Security=yes;Database=YourDatabase"
SelectCommand="SELECT [field1], [field2] FROM [YourTable]"></asp:SqlDataSource >

////
Now it will show the data in your table.

4. To update the data...

You should specify an "UpdateCommand" to the sqldatasource of your "gridview".

ex: UpdateCommand="UPDATE [YourTable] SET [field1]=@field1 WHERE [field2]=@field2"

Try...............



-- modified at 6:03 Wednesday 9th May, 2007

Sherin Iranimose

GeneralRe: how to make invisible comboBox visible in GridView Pin
AaronNeo9-May-07 17:48
AaronNeo9-May-07 17:48 
GeneralRe: how to make invisible comboBox visible in GridView Pin
Sherin Iranimose9-May-07 18:19
Sherin Iranimose9-May-07 18:19 
GeneralRe: how to make invisible comboBox visible in GridView Pin
AaronNeo11-May-07 0:29
AaronNeo11-May-07 0:29 
GeneralRe: how to make invisible comboBox visible in GridView Pin
Sherin Iranimose11-May-07 0:35
Sherin Iranimose11-May-07 0:35 
Questioncode behind [modified] Pin
Lohchubh8-May-07 14:57
Lohchubh8-May-07 14:57 
AnswerRe: code behind Pin
enjoycrack8-May-07 17:14
enjoycrack8-May-07 17:14 
AnswerRe: code behind Pin
Christian Graus8-May-07 18:07
protectorChristian Graus8-May-07 18:07 
QuestionAJAX in Existing Web applications Pin
seemamltn8-May-07 11:54
seemamltn8-May-07 11:54 
AnswerRe: AJAX in Existing Web applications Pin
Mark Greenwood8-May-07 13:24
Mark Greenwood8-May-07 13:24 
GeneralRe: AJAX in Existing Web applications Pin
seemamltn8-May-07 14:08
seemamltn8-May-07 14:08 
Questionloop to delete row from datatable Pin
raquidd228-May-07 9:08
raquidd228-May-07 9:08 
AnswerRe: loop to delete row from datatable Pin
Geo Pa8-May-07 14:23
Geo Pa8-May-07 14:23 
QuestionMy button click event runs twice in my VS 2005 - need help Pin
Slow Learner8-May-07 8:25
Slow Learner8-May-07 8:25 
AnswerRe: My button click event runs twice in my VS 2005 - need help Pin
Dave Doknjas8-May-07 13:16
Dave Doknjas8-May-07 13:16 
QuestionSet all Validation Groups at Page Load ? Pin
digsy_8-May-07 7:52
digsy_8-May-07 7:52 
QuestionCustom User Control Pin
Ridge Howison8-May-07 5:31
Ridge Howison8-May-07 5:31 
QuestionCheck all treeview nodes Pin
waddie18-May-07 4:27
waddie18-May-07 4:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.