Click here to Skip to main content
15,914,452 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHow to save datagrid values in the database. Pin
jaraldumary18-Jan-09 23:01
jaraldumary18-Jan-09 23:01 
AnswerRe: How to save datagrid values in the database. Pin
SeMartens19-Jan-09 0:08
SeMartens19-Jan-09 0:08 
AnswerRe: How to save datagrid values in the database. Pin
Reza Raad19-Jan-09 0:30
Reza Raad19-Jan-09 0:30 
GeneralRe: How to save datagrid values in the database. Pin
jaraldumary19-Jan-09 0:49
jaraldumary19-Jan-09 0:49 
AnswerRe: How to save datagrid values in the database. Pin
Reza Raad19-Jan-09 9:14
Reza Raad19-Jan-09 9:14 
Questiondiff. betn selection methods for XML [modified] Pin
Member 398136618-Jan-09 20:25
Member 398136618-Jan-09 20:25 
AnswerRe: diff. betn selection methods for XML Pin
N a v a n e e t h18-Jan-09 21:09
N a v a n e e t h18-Jan-09 21:09 
Questiondatagrid problem! Pin
RajpootRohan18-Jan-09 20:09
professionalRajpootRohan18-Jan-09 20:09 
Hi to all,

I have a datagrid in which there is a checkbox and a textbox.
The user can change the value in textbox.
below there is update button.When the user presses the update button
the textbox value should be updated.

For this I have done this:
protected void BtnUpdate_Click(object sender, EventArgs e)
{
    dt = (DataTable)Session["data"];
    DataGrid2.DataSource = dt;
    DataGrid2.DataBind();

    //if I will not bind then it will not go in foreach loop.
    //as it will not find any items in the datagrid.

    CheckBox chkSelected = new CheckBox();

    foreach (DataGridItem dgItem in DataGrid2.Items)
    {
        chkSelected = (CheckBox)dgItem.FindControl("chkSelection");

        if (chkSelected.Checked != true)
        {
            TextBox TxtQTY = (TextBox)dgItem.Cells[2].FindControl("TxtQTY");
            string Txt2 = TxtQTY.Text;

        }
        else
        {
            int a = 1;
        }

    }

}



The problem is that this functionality is not taking the user input.
In the starting I have done databing because of which it is taking the previous value.But if I will not bind the data It is not going in the foreach loop to check wether any checkbox is selected or not as in debugging it is showing that the item collection in the datagrid is empty.

Please give some suggestions...
Thanks in advance.

cheers,
sneha

AnswerRe: datagrid problem! Pin
Aman Bhullar18-Jan-09 20:38
Aman Bhullar18-Jan-09 20:38 
AnswerRe: datagrid problem! Pin
_AK_18-Jan-09 21:53
_AK_18-Jan-09 21:53 
AnswerRe: datagrid problem! Pin
N a v a n e e t h18-Jan-09 22:16
N a v a n e e t h18-Jan-09 22:16 
GeneralRe: datagrid problem! Pin
RajpootRohan18-Jan-09 22:53
professionalRajpootRohan18-Jan-09 22:53 
Questionindicator to show online or offline Pin
meghamaharshi18-Jan-09 19:45
meghamaharshi18-Jan-09 19:45 
AnswerRe: indicator to show online or offline Pin
Abhijit Jana18-Jan-09 20:05
professionalAbhijit Jana18-Jan-09 20:05 
GeneralRe: indicator to show online or offline Pin
meghamaharshi18-Jan-09 20:37
meghamaharshi18-Jan-09 20:37 
GeneralRe: indicator to show online or offline Pin
_AK_18-Jan-09 22:03
_AK_18-Jan-09 22:03 
GeneralRe: indicator to show online or offline Pin
meghamaharshi18-Jan-09 22:19
meghamaharshi18-Jan-09 22:19 
AnswerRe: indicator to show online or offline Pin
Abhishek Sur18-Jan-09 20:40
professionalAbhishek Sur18-Jan-09 20:40 
GeneralRe: indicator to show online or offline Pin
meghamaharshi18-Jan-09 20:44
meghamaharshi18-Jan-09 20:44 
AnswerRe: indicator to show online or offline Pin
Christian Graus19-Jan-09 2:08
protectorChristian Graus19-Jan-09 2:08 
GeneralRe: indicator to show online or offline Pin
Abhishek Sur19-Jan-09 20:11
professionalAbhishek Sur19-Jan-09 20:11 
QuestionDirectory Path in webserver Pin
C#Coudou18-Jan-09 19:09
C#Coudou18-Jan-09 19:09 
AnswerRe: Directory Path in webserver Pin
Reza Raad18-Jan-09 20:17
Reza Raad18-Jan-09 20:17 
GeneralRe: Directory Path in webserver [modified] Pin
C#Coudou18-Jan-09 20:20
C#Coudou18-Jan-09 20:20 
GeneralRe: Directory Path in webserver Pin
Reza Raad18-Jan-09 23:20
Reza Raad18-Jan-09 23:20 

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.