Answered by:
Problem with Updating Using Dropdownlist in GridView

Question
-
User1115497719 posted
Hi Guys,
I was used TextBox in the GridView Then I Replace this textBox with Dropdownlist
and i fetched all the data from the database using DataSource in Editing Mode
But The problem is when i choose item from the dropdownlist to update it,it returns to Empty
(with No values) in the DropDownList??whats the problem?
Any Help would Be Appreciated....
Thanks Alot
Here is the code
<%
@ Page Language="C#" MasterPageFile="~/Master.master" AutoEventWireup="true" CodeFile="AddEditCategory.aspx.cs" Inherits="Admin_AddEditCategory" Title="Untitled Page" %><
asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"></
<br />asp:Content>Tuesday, February 23, 2010 7:06 PM
Answers
-
User-1635004338 posted
Hi saedabaid,
I guess it is caused by "_" in "Category_id" name, if you use OldValuesParameterFormatString as "***_". It seems there is one post like this issue before, I am not quite sure. You can try to use different field name without "_" to see if it works.
Thanks,
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, March 1, 2010 2:43 AM
All replies
-
User-1355075389 posted
Use AutoPostBack = "true" for ddl.
Tuesday, February 23, 2010 10:05 PM -
User1115497719 posted
Unfortunatelly,It didnt Solve the Problem
I think It is Strange Problem
Wednesday, February 24, 2010 4:52 AM -
User1115497719 posted
Omg,It is so strange,Because I Built Asimple Example Using TextBox Not DropDownList
And Still it didnt solve (When I Update It Returns To The Same Previous Item Or Empty TextBox)
Heres is My Code of My Simple Example
<%
@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %><!
<
<
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">html xmlns="http://www.w3.org/1999/xhtml" >head runat="server"></
<
<title>Untitled Page</title>head>body></
</
</form>body>html>Wednesday, February 24, 2010 5:40 AM -
User-1635004338 posted
Hi saedabaid,
I guess it is caused by "_" in "Category_id" name, if you use OldValuesParameterFormatString as "***_". It seems there is one post like this issue before, I am not quite sure. You can try to use different field name without "_" to see if it works.
Thanks,
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, March 1, 2010 2:43 AM -
User1115497719 posted
thank alot for helping me
Tuesday, March 2, 2010 12:39 PM