Click here to Skip to main content
15,902,939 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: FCKEditor Pin
sriharsha_127-Apr-10 21:15
sriharsha_127-Apr-10 21:15 
Questiondisplay data of dynamique table Pin
amina897-Apr-10 13:11
amina897-Apr-10 13:11 
Question.Net Remoting y it is used Pin
Sandesh M Patil7-Apr-10 7:26
Sandesh M Patil7-Apr-10 7:26 
AnswerRe: .Net Remoting y it is used Pin
Not Active7-Apr-10 8:15
mentorNot Active7-Apr-10 8:15 
AnswerRe: .Net Remoting y it is used Pin
Mogamboo_Khush_Hua7-Apr-10 20:37
Mogamboo_Khush_Hua7-Apr-10 20:37 
AnswerRe: .Net Remoting y it is used Pin
Keith Barrow7-Apr-10 23:38
professionalKeith Barrow7-Apr-10 23:38 
GeneralRe: .Net Remoting y it is used Pin
Mogamboo_Khush_Hua8-Apr-10 0:08
Mogamboo_Khush_Hua8-Apr-10 0:08 
QuestionCheckBox CheckedChanged automatically fire Pin
abarcadev7-Apr-10 7:17
abarcadev7-Apr-10 7:17 
I have a problem with a checkbox. CheckedChanged event is triggered each time I update my result set.mi page is as follows:

Image Example

1.i show the records of the team 1 and team 2.

2.uncheck the firts row of the team1 fire the event and all is ok .

3.when i show the team 2 the event fire again and change te status of the checkbox.



I have an UpdatePanel->GridView->Columns->TemplateField

aspx code:

<asp:TemplateField HeaderText="Alineable">
     <ItemTemplate>
        <asp:CheckBox ID="chkEstatus" Checked=' <%# ((string)Eval("Estatus"))=="Alineable"?true:false%>'
                                        runat="server" AutoPostBack="True" OnCheckedChanged="chkEstatus_CheckedChanged" />
      </ItemTemplate>
                               
</asp:TemplateField>


C# code OnLoad event. in each posback i call the Filter Method and Fill the gridview
protected override void OnLoad(EventArgs e)
{
    if (Utileria.ValidarSesion(Session["Usuario"], 0))
    {
        if (!Page.IsPostBack)
            ObtenerEquipos();
        usuario = (Usuario)Session["Usuario"];
        Filtrar();//Fill the gridview
    }
}


C# code of the event:
protected void chkEstatus_CheckedChanged(object sender, EventArgs e)

  {//this event fire when the user check or unchek the chechbox.
   //After user check or uncheck and the user change the filter this
   //automatically fire(i don't know why)

      int jugadorId;

      try

      {

          CheckBox chkAlineable = (CheckBox)sender;

          int rowIndex = ((GridViewRow)chkAlineable.Parent.Parent).RowIndex;

          jugadorId = (int)gvJugadores.DataKeys[rowIndex].Value;

          Roster roster = new Roster();

          roster.EquipoId = int.Parse(ddlEquipos.SelectedValue);

          roster.JugadorId = jugadorId;

          roster.Estatus = chkAlineable.Checked ? "Alineable" : "Inalineable";

          roster.ActualizarEstatus(null);

          Filtrar();

          upJugadores.Update();

      }

      catch { throw; }

  }




C# code of the to fill the gridview
private void Filtrar()//get the data from de data source an fill gridview

{

    gvJugadores.DataSource = JugadoresColeccion.FiltrarRoster(ddlOpcionesBusqueda.SelectedValue, txtBusqueda.Text, int.Parse(ddlEquipos.SelectedValue));

    gvJugadores.DataBind();

}



I need to avoid this behavior becouse the checkbox state change my data.

I conclude that the status of the checkbox to be different in the other resultset automatically fires the event that are in the same row.
but I don´t know how to solve it. please help.
AnswerRe: CheckBox CheckedChanged automatically fire Pin
Not Active7-Apr-10 7:52
mentorNot Active7-Apr-10 7:52 
GeneralRe: CheckBox CheckedChanged automatically fire Pin
abarcadev7-Apr-10 8:29
abarcadev7-Apr-10 8:29 
GeneralRe: CheckBox CheckedChanged automatically fire Pin
Not Active7-Apr-10 9:02
mentorNot Active7-Apr-10 9:02 
QuestionWhen Do we use dataset.tables[0]!=null and dataset.tables[0].rows.count >0 Pin
raghvendrapanda7-Apr-10 6:29
raghvendrapanda7-Apr-10 6:29 
AnswerRe: When Do we use dataset.tables[0]!=null and dataset.tables[0].rows.count >0 Pin
Brij7-Apr-10 6:45
mentorBrij7-Apr-10 6:45 
GeneralRe: When Do we use dataset.tables[0]!=null and dataset.tables[0].rows.count >0 Pin
raghvendrapanda7-Apr-10 6:48
raghvendrapanda7-Apr-10 6:48 
GeneralRe: When Do we use dataset.tables[0]!=null and dataset.tables[0].rows.count >0 Pin
Not Active7-Apr-10 7:05
mentorNot Active7-Apr-10 7:05 
AnswerRe: When Do we use dataset.tables[0]!=null and dataset.tables[0].rows.count >0 Pin
Anurag Gandhi7-Apr-10 20:47
professionalAnurag Gandhi7-Apr-10 20:47 
QuestionPass Data from Page to Control and find current loaded Control Pin
-Muc_7-Apr-10 6:02
-Muc_7-Apr-10 6:02 
AnswerRe: Pass Data from Page to Control and find current loaded Control Pin
Brij7-Apr-10 6:15
mentorBrij7-Apr-10 6:15 
GeneralRe: Pass Data from Page to Control and find current loaded Control Pin
-Muc_7-Apr-10 6:46
-Muc_7-Apr-10 6:46 
GeneralRe: Pass Data from Page to Control and find current loaded Control Pin
Brij7-Apr-10 17:40
mentorBrij7-Apr-10 17:40 
GeneralRe: Pass Data from Page to Control and find current loaded Control Pin
-Muc_8-Apr-10 21:00
-Muc_8-Apr-10 21:00 
QuestionCreate login form wizard asp - add extra field for security login Pin
alexa_adrian20017-Apr-10 3:38
alexa_adrian20017-Apr-10 3:38 
AnswerRe: Create login form wizard asp - add extra field for security login Pin
Not Active7-Apr-10 5:17
mentorNot Active7-Apr-10 5:17 
GeneralRe: Create login form wizard asp - add extra field for security login Pin
alexa_adrian20017-Apr-10 20:15
alexa_adrian20017-Apr-10 20:15 
QuestionAutomatic logout Pin
Morgs Morgan7-Apr-10 3:28
Morgs Morgan7-Apr-10 3:28 

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.