Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/04/2008, 08:51
PAYOLITA
 
Fecha de Ingreso: abril-2008
Mensajes: 1
Antigüedad: 16 años
Puntos: 0
Exclamación GridViews dependientes

programo en C#, necesito comparar dos GridView en tiempo de ejecución...
mis dos grids son aguales, tienen un campo tipo CheckBox y otro campo Label que recibe un nombre...estos al momento de dar click al checkbox, se guardan en un textbox1 y un textbox2 respectivamente.

explicado de otro modo, tengo dos gridview para seleccion de usuarios, uno es para "Con Atencion" y otro es "Con Conocimiento" y no tienen que repetirse.. si ya los seleccioné en el primero, que en el segundo ya no me aparezcan...

pondré el código para que sea un poco mas entendible (solo es de un GridView, pero como antes mencioné, son iguales, con nombre distinto solamente)

<tr>
<td align="right">

<asp:Label ID="Label13" runat="server" Font-Names="Verdana" Height="14px" Font-Size="10pt">
Para:
</asp:Label>
<br />
<asp:Label ID="Label17" runat="server" Font-Names="Verdana" Font-Size="10pt" ForeColor="#404040"
Height="14px">
[Atención]
</asp:Label>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AcuerdosConnectionString %>"
SelectCommand="SELECT TP.Id_Personal, PE.NombreCompleto, TP.CveResponsable FROM TurnosPersonal AS TP INNER JOIN Personal AS PE ON PE.CveResponsable = TP.CveResponsable WHERE (TP.Id_Personal = @Id_Personal) AND (TP.CveResponsable !=@txtparaconocimiento)">
<SelectParameters>
<asp:SessionParameter Name="Id_Personal" SessionField="claveUsuario" Type="Int64" />
<asp:ControlParameter ControlID="txtParaConocimiento" DefaultValue="0" Name="txtparaconocimiento"
PropertyName="Value" />
</SelectParameters>
</asp:SqlDataSource>
</td>
<td align="left">
<table>
<tr>
<td>
<asp:UpdatePanel ID="up3" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<ContentTemplate>
<asp:TextBox ID="txtParaNombre" runat="server" Font-Names="Arial" Font-Size="Small"
Height="30px" ReadOnly="True" TabIndex="8" TextMode="MultiLine" Width="563px"></asp:TextBox>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>
<asp:UpdatePanel ID="up1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="False">
<ContentTemplate>
<asp:Button ID="btnMostrar" runat="server" Text="A" OnClientClick="Mostrar();" ></asp:Button>
</ContentTemplate>


</asp:UpdatePanel>
</td>
</tr>
<tr>
<td colspan="2">
<div id="divUsuarios" visible="false" style="visibility: hidden">
<table>
<tr>
<td>
<asp:GridView ID="gv" runat="server" AlternatingRowStyle-BackColor="#fffbd6"
AutoGenerateColumns="False" DataSourceID="SqlDataSource1" DataKeyNames="CveResponsable">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="usrName" runat="server" Text='<%# BIND("NombreCompleto") %>' Visible="false" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<center>
Usuarios:</center>
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="usr" runat="server" Text='<%# BIND("NombreCompleto") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<AlternatingRowStyle BackColor="SeaShell" />
</asp:GridView>
</td>
</tr>
<tr>
<td colspan="2">
<asp:UpdatePanel ID="up2" runat="server" ChildrenAsTriggers="False" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="btnOcultar" runat="server" Text="Ok" OnClientClick="Ocultar();" OnClick="btnOcultar_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>