ASP.NET and C # - Gridview line requirement

0

Just as there is a RequiredFieldValidator in ASP.Net site forms, which requires filling in a field, is there any way to have a gridview with at least one row?

For example, I have in my site (ASP.Net with C #) a part of resumes registration. As a required field, you have the user training, which you should fill out with one of the Dropdownlist items.

Then you have the option to add the training courses. Each added course goes to a GridView. So I would have to have this gridview to be able to register the curriculum. If you do not have this gridview present (with at least one row of data), it does not register the curriculum.

Follow the Gridview code:

<asp:GridView ID="gwFormacao" runat="server" AutoGenerateColumns="False" HeaderStyle-BackColor="#E74310" HeaderStyle-ForeColor="White">
                                    <Columns>
                                        <asp:BoundField DataField="curso" HeaderText="Curso" HtmlEncode="False" />
                                        <asp:BoundField DataField="instituicao" HeaderText="Instituição" HtmlEncode="False" />
                                        <asp:BoundField DataField="anoConclusao" HeaderText="Ano/Previsão de conclusão" HtmlEncode="False" />
                                        <asp:TemplateField HeaderText="Op&#231;&#245;es">
                                        <ItemTemplate>
                                            <asp:ImageButton ID="imgBtnExcluirFormacao" runat="server" ImageUrl="~/imagens/excluir16.png" ToolTip="Excluir situação" CommandArgument='<%# DataBinder.Eval(Container,"RowIndex") %>' oncommand="imgBtnExcluirFormacao_Command" />
                                            <ajaxtoolkit:ConfirmButtonExtender ID="cbeExcluirSituacao" runat="server" TargetControlID="imgBtnExcluirFormacao" DisplayModalPopupID="pmeConfirmBox"></ajaxtoolkit:ConfirmButtonExtender>
                                            <ajaxtoolkit:ModalPopupExtender ID="pmeConfirmBox" runat="server" TargetControlID="imgBtnExcluirFormacao" PopupControlID="pnlPopUpConfirm" OkControlID="lkbOk" CancelControlID="lkbCancelar"></ajaxtoolkit:ModalPopupExtender>
                                            <asp:Panel ID="pnlPopUpConfirm" runat="server" DefaultButton="lkbOk" CssClass="panel">
                                                <table width="100%">
                                                    <tr>
                                                        <td colspan="2" align="left"><asp:Label ID="lblTitulo" runat="server" Text="Questão"></asp:Label></td>
                                                    </tr>
                                                    <tr>
                                                        <td style="width: 60px" valign="middle" align="left"><asp:Image ID="imgPopUp" runat="server" ImageUrl="~/imagens/confirmacao32.png" /></td>
                                                        <td valign="middle" align="left"><asp:Label ID="lblMensagem" runat="server" Text="Confirma exclusão da formação"></asp:Label></td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2" align="right">
                                                            <asp:LinkButton ID="lkbOk" runat="server" Text="Ok"></asp:LinkButton>
                                                            &nbsp;&nbsp;<asp:LinkButton ID="lkbCancelar" runat="server" Text="Cancelar"></asp:LinkButton>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </asp:Panel>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" Width="35px" />
                                        </asp:TemplateField>
                                    </Columns>
                                    </asp:GridView>
    
asked by anonymous 04.08.2016 / 15:44

0 answers