Adding asp table inside Templatefield - html

Here i have a problem with adding asp table inside the template field in gridview.
in my gridview one button is there named as "View" when i click this it should display all information below that row... so how do i do that??? should i use template field?? how to add button("View") for each row using this template field
Please correct my code
<asp:TemplateField HeaderText="View">
<ItemTemplate>
<asp:Table ID="tblModify" runat="server" Width="100%" Visible="False" CssClass="table">
<asp:TableRow>
<asp:TableCell ID="TableCell35" runat="server" HorizontalAlign="Right"><h1>Debit Information</h1></asp:TableCell>
<asp:TableCell></asp:TableCell>
<asp:TableCell></asp:TableCell>
<asp:TableCell></asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow6" runat="server">
<asp:TableCell ID="TableCell3" runat="server" HorizontalAlign="Right">DebitNoteNumber</asp:TableCell><asp:TableCell
ID="TableCell4" runat="server">
<asp:Label ID="lblDebitNoteId" runat="server" MaxLength="50" Columns="70" />
</asp:TableCell><asp:TableCell ID="TableCell5" runat="server" HorizontalAlign="Right">Date</asp:TableCell><asp:TableCell
ID="TableCell6" runat="server" HorizontalAlign="Left">
<asp:Label ID="lblDate" runat="server" MaxLength="30" Columns="50"></asp:Label>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow1" runat="server">
<asp:TableCell ID="TableCell11" runat="server" HorizontalAlign="Right">Patient Name</asp:TableCell><asp:TableCell
ID="TableCell37" runat="server" HorizontalAlign="Left">
<asp:Label ID="lblPatientName" runat="server" MaxLength="50" Columns="70"></asp:Label>
</asp:TableCell>
<asp:TableCell ID="TableCell1" runat="server" HorizontalAlign="Right">Patient Number</asp:TableCell><asp:TableCell
ID="TableCell2" runat="server" HorizontalAlign="Left">
<asp:Label ID="lblPatientId" runat="server" MaxLength="50" Columns="70"></asp:Label>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow2" runat="server">
<asp:TableCell ID="TableCell38" runat="server" HorizontalAlign="Right">Phone Number</asp:TableCell><asp:TableCell
ID="TableCell39" runat="server" HorizontalAlign="Left">
<asp:Label ID="lblPatientPhoneNumber" runat="server"> </asp:Label>
</asp:TableCell>
<asp:TableCell ID="TableCell7" runat="server" HorizontalAlign="Right">Bill Number</asp:TableCell><asp:TableCell
ID="TableCell8" runat="server" HorizontalAlign="Left">
<asp:Label ID="lblBillId" runat="server"> </asp:Label>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow5" runat="server">
<asp:TableCell ID="TableCell9" runat="server" HorizontalAlign="Right">Receipt Number</asp:TableCell><asp:TableCell
ID="TableCell10" runat="server" HorizontalAlign="Left">
<asp:Label ID="lblReceiptId" runat="server" MaxLength="30" Columns="50"></asp:Label>
</asp:TableCell><asp:TableCell ID="TableCell13" runat="server" HorizontalAlign="Right">Amount</asp:TableCell><asp:TableCell
ID="TableCell14" runat="server" HorizontalAlign="Left">
<asp:Label ID="lblAmount" runat="server" MaxLength="30" Columns="50"></asp:Label>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow8" runat="server">
<asp:TableCell ID="TableCell15" runat="server" HorizontalAlign="Right">Balacne</asp:TableCell><asp:TableCell
ID="TableCell16" runat="server" HorizontalAlign="Left">
<asp:Label ID="lblBalacne" runat="server" MaxLength="30" Columns="50"></asp:Label></td>
</asp:TableCell><asp:TableCell></asp:TableCell><asp:TableCell></asp:TableCell>
</asp:TableRow>
</asp:Table>
</ItemTemplate>
</asp:TemplateField>
if i use this code, i could't find button("View") in my gridview...

U can use Modal Pop Up Extender.
write simple html table tag(TR,TD) with your server side tag into the modal pop up.When You click on "View" the details will be shown into Modal pop up.

Related

How do I hide/show a DIV inside a grid ItemTemplate?

I want to set individual DIVs inside a grid visible/hidden programmatically like so, but it isn't working. How would you fix this code?
foreach (DataGridItem dgItem in dgW.Items)
{
HtmlGenericControl dvGoodRow =
(HtmlGenericControl)dgItem.FindControl("dvGoodRow");
HtmlGenericControl dvBadRow =
(HtmlGenericControl)dgItem.FindControl("dvBadRow");
dvGoodRow.Visible = true;
dvBadRow.Visible = false;
}
Debug sessions show that the Visible attribute I set above does take effect at least in my watch window, but visually on the browser I see no change. I have a grid like the one below:
<asp:datagrid id="dgW" AutoGenerateColumns="False" ShowHeader="False" ShowFooter="False" runat="server" DataKeyField="SID" CellPadding="0" GridLines="None" AllowSorting="True" OnItemDataBound="dgW_ItemDataBound">
<HeaderStyle />
<FooterStyle>
</FooterStyle>
<Columns>
<asp:TemplateColumn HeaderText="SID" SortExpression="SID">
<ItemTemplate>
<asp:Label ID="lblSID" Runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "SID") %>'></asp:Label>
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Extension" SortExpression="ExtensionStopDate">
<ItemTemplate>
<asp:Label id="lblExtensionStopDate" Runat="server" text='<%# String.Format("{0:MM/dd/yyyy}", DataBinder.Eval(Container.DataItem, "ExtensionStopDate"))%>'></asp:Label>
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<ItemTemplate>
<div id="dvGoodRow" runat="server" hidden>
<div>
<asp:Label runat="server" ID="lblGoodRow">
<i id="icnGoodRow" runat="server"></i>
</asp:Label>
</div>
</div>
<div id="dvBadRow" runat="server" hidden>
<div>
<asp:Label runat="server" ID="lblBadRow">
<i id="icnBadRow" runat="server"></i>
</asp:Label>
</div>
</div>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
Remove that 'hidden' property and use visible
<div id="dvGoodRow" runat="server" visible="false">
<div id="dvBadRow" runat="server" visible="false">
Here's what I ended up doing to fix the code: I switched to showing/hiding ASP.NET Panels instead of DIVs!
<asp:TemplateColumn>
<ItemTemplate>
<asp:Panel runat="server" ID="pnlGoodRow" Visible="False">
<div id="dvGoodRow">
<asp:Label runat="server" ID="lblGoodRow">
<i id="icnGoodRow" runat="server"></i>
</asp:Label>
</div>
</asp:Panel>
<asp:Panel runat="server" ID="pnlBadRow" Visible="False">
<div id="dvBadRow">
<asp:Label runat="server" ID="lblBadRow">
<i id="icnBadRow" runat="server"></i>
</asp:Label>
</div>
</asp:Panel>
</ItemTemplate>
</asp:TemplateColumn>
So in the code, I now hide/show the Panel elements instead of DIVs:
foreach (DataGridItem dgItem in dgW.Items)
{
System.Web.UI.WebControls.Panel pnlGoodRow =
(System.Web.UI.WebControls.Panel)dgItem.FindControl("pnlGoodRow");
System.Web.UI.WebControls.Panel pnlBadRow =
(System.Web.UI.WebControls.Panel)dgItem.FindControl("pnlBadRow");
pnlGoodRow.Visible = true;
pnlBadRow.Visible = false;
}
This works!

How to add an onClick event to an HTML radio button in asp.net

I have multiple tabs on my page and currently I am binding all dropdownlists on every tab at page load.
I want to bind the dropdownlists only when the tab is selected. I also want to clear the gridviews when the tab is changed.
This is my HTML code
<li>
<input type="radio" id="tab1d" name="tabs1" runat="server"/>
<label for="tab1d">Search</label>
<div id="tab-content1d" class="tab-content animated fadeIn" style="background-color:white; padding:10px; ">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label4" runat="server" Text="Select Platform"></asp:Label>
<asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DropDownList3_SelectedIndexChanged" CssClass="inputs" Width="150px"></asp:DropDownList>
<asp:Label ID="Label10" runat="server" Text="Select Family Name"></asp:Label>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true" CssClass="inputs" Width="150px" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"></asp:DropDownList>
<asp:Label ID="Label11" runat="server" Text="Select price Level"></asp:Label>
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="true" CssClass="inputs" Width="150px" ></asp:DropDownList>
<asp:Button ID="Button7" runat="server" Text="Search" CssClass="buttons" OnClick="Button7_Click"/><br /><br />
<div id="gdvLeft">
<asp:GridView ID="gdvFamilyname" runat="server" EnableViewState="True" class="grid" RowStyle-CssClass="rows"></asp:GridView>
</div>
<div id="gdvRight">
<asp:GridView ID="gdvQuantity" runat="server" EnableViewState="True" class="grid" RowStyle-CssClass="rows"></asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</li>
Hi Himani, Try like this -
<input type="radio" value="Click Me" onclick="rdioClick();" />
In Javascript -
function rdioClick() {
var GridView1 = document.getElementById('GridView1');
GridView1.innerHTML = "";
}
Thanks :)

bootstrap loses glow form-control

I have a very strange problem happening with an ASP.NET 4.5 website, using bootstrap for styling. I have set the class of the controls to form-control-static for alignment purposes. However, I'm getting different display results across 3 browsers.
IE9, used by some of our users, the control glows when focused or on mouseover. This is fine.
Chrome, the textbox border will go blue when focused (but no glow). Nothing happens on mouseover (fine with me).
IE11, which is the main used browser for this app, controls do not glow nor change border color on focus. However, if I click into each textbox then tab to the next, the border turns to blue only on tabbing to the next field. The control stays blue bordered even as I navigate through different fields (see te following screenshot).
If I use form-control (not static) I get nice rounded controls with blue glow on focus. But the layout is not how I want it.
<div class="form-group">
<asp:Label ID="lblReduction" runat="server" Font-Bold="True" Text="Reduction:" Width="320px"></asp:Label>
<asp:DropDownList ID="ddlReduction" runat="server" AutoPostBack="True" CssClass="form-control-static" OnSelectedIndexChanged="ddlReduction_SelectedIndexChanged" Width="220px">
<asp:ListItem><-- Please Select --></asp:ListItem>
<asp:ListItem>Yes</asp:ListItem>
<asp:ListItem>No</asp:ListItem>
</asp:DropDownList>
</div>
<div class="form-group">
<asp:Label ID="lblDLACareComponentAward" runat="server" CssClass="form-control-static" Font-Bold="True" Text="DLA Care Component Payment Awarded (£):" Width="320px"></asp:Label>
<asp:TextBox ID="DLACareComponentAwardTextBox" runat="server" CssClass="form-control-static" MaxLength="8" Text='<%# Bind("DLACareComponentAward") %>' Width="220px" />
<asp:RequiredFieldValidator ID="reqvalDLACareAwarded" runat="server" ControlToValidate="DLACareComponentAwardTextBox" Display="Dynamic" Enabled="False" ErrorMessage="DLA Care Component Payment Required" font-bold="true" ForeColor="Red" SetFocusOnError="True">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="regexDLApaymentAwarded" runat="server" ControlToValidate="DLACareComponentAwardTextBox" Display="Dynamic" ErrorMessage="DLA Care Component Payment Awarded must be a money value" font-bold="true" ForeColor="Red" ValidationExpression="[0-9]+(\.[0-9][0-9]?)?" ValidationGroup="PIP">*</asp:RegularExpressionValidator>
</div>
<div class="form-group">
<asp:Label ID="lblDLAMobilityComponentAward" runat="server" Font-Bold="True" Text="DLA Mobility Component Payment Awarded (£):" Width="320px"></asp:Label>
<asp:TextBox ID="DLAMobilityComponentAwardTextBox" runat="server" CssClass="form-control-static" MaxLength="8" Text='<%# Bind("DLAMobilityComponentAward") %>' Width="220px" />
<asp:RequiredFieldValidator ID="reqvalMobilityComponent" runat="server" ControlToValidate="DLAMobilityComponentAwardTextBox" Display="Dynamic" Enabled="False" ErrorMessage="DLA Mobility Component Payment" font-bold="true" ForeColor="Red" SetFocusOnError="True" ValidationGroup="PIP">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="regexDLApaymentAwarded0" runat="server" ControlToValidate="DLAMobilityComponentAwardTextBox" Display="Dynamic" ErrorMessage="DLA Mobility Component Payment Awarded must be a money value" font-bold="true" ForeColor="Red" ValidationExpression="[0-9]+(\.[0-9][0-9]?)?" ValidationGroup="PIP">*</asp:RegularExpressionValidator>
</div>
<div class="form-group">
<asp:Label ID="lblDailyPIPPoints" runat="server" Font-Bold="True" Text="Daily PIP Points:" Width="320px"></asp:Label>
<asp:TextBox ID="DailyPIPPointsTextBox" runat="server" CssClass="form-control-static" MaxLength="10" Text='<%# Bind("DailyPIPPoints") %>' Width="220px" />
<asp:RequiredFieldValidator ID="reqvalDailyPIPPoints" runat="server" ControlToValidate="DailyPIPPointsTextBox" Display="Dynamic" Enabled="False" ErrorMessage="Daily PIP Points" font-bold="true" ForeColor="Red" SetFocusOnError="True" ValidationGroup="PIP">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="regexDailyPIP" runat="server" ControlToValidate="DailyPIPPointsTextBox" Display="Dynamic" ErrorMessage="Only numbers can be used for Daily PIP Points" font-bold="true" ForeColor="Red" ValidationExpression="^[0-9]*$" ValidationGroup="PIP">*</asp:RegularExpressionValidator>
</div>
<div class="form-group">
<asp:Label ID="lblMobilityPIPPoints" runat="server" Font-Bold="True" Text="Mobility PIP Points:" Width="320px"></asp:Label>
<asp:TextBox ID="MobililtyPIPPointsTextBox" runat="server" CssClass="form-control-static" MaxLength="10" Text='<%# Bind("MobililtyPIPPoints") %>' Width="220px" />
<asp:RequiredFieldValidator ID="reqvalMobilityPIPPoints" runat="server" ControlToValidate="MobililtyPIPPointsTextBox" Display="Dynamic" Enabled="False" ErrorMessage="Mobility PIP Points" font-bold="true" ForeColor="Red" SetFocusOnError="True" ValidationGroup="PIP">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="regexMobilityPIPPoints" runat="server" ControlToValidate="MobililtyPIPPointsTextBox" Display="Dynamic" ErrorMessage="Only numbers can be used for Mobility PIP Points" font-bold="true" ForeColor="Red" ValidationExpression="^[0-9]*$" ValidationGroup="PIP">*</asp:RegularExpressionValidator>
</div>
<asp:Panel ID="pnlPIP" runat="server" Visible="false">
<div class="form-group">
<asp:Label ID="lblPIPDailyLivingAward" runat="server" Font-Bold="True" Text="PIP Daily Living Award (£):" Width="320px"></asp:Label>
<asp:TextBox ID="PIPDailyLivingAwardTextBox" runat="server" CssClass="form-control-static" MaxLength="8" Text='<%# Bind("PIPDailyLivingAward") %>' Width="220px" />
<asp:RequiredFieldValidator ID="reqvalDailyLivingAward" runat="server" ControlToValidate="PIPDailyLivingAwardTextBox" Display="Dynamic" Enabled="False" ErrorMessage="PIP Daily Living Award Required" font-bold="true" ForeColor="Red" SetFocusOnError="True" ValidationGroup="PIP">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="regexDLApaymentAwarded1" runat="server" ControlToValidate="PIPDailyLivingAwardTextBox" Display="Dynamic" ErrorMessage="PIP Daily Living Awarded must be a money value" font-bold="true" ForeColor="Red" ValidationExpression="[0-9]+(\.[0-9][0-9]?)?" ValidationGroup="PIP">*</asp:RegularExpressionValidator>
</div>
<div class="form-group">
<asp:Label ID="lblPIPMobilityAward" runat="server" Font-Bold="True" Text="PIP Mobility Award (£):" Width="320px"></asp:Label>
<asp:TextBox ID="PIPMobilityAwardTextBox" runat="server" CssClass="form-control-static" MaxLength="8" Text='<%# Bind("PIPMobilityAward") %>' Width="220px" />
<asp:RequiredFieldValidator ID="reqvalmobilityAward" runat="server" ControlToValidate="PIPMobilityAwardTextBox" Display="Dynamic" Enabled="False" ErrorMessage="PIP mobility Award Required" font-bold="true" ForeColor="Red" SetFocusOnError="True" ValidationGroup="PIP">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="regexDLApaymentAwarded2" runat="server" ControlToValidate="PIPMobilityAwardTextBox" Display="Dynamic" ErrorMessage="PIP Mobility Award must be a money value" font-bold="true" ForeColor="Red" ValidationExpression="[0-9]+(\.[0-9][0-9]?)?" ValidationGroup="PIP">*</asp:RegularExpressionValidator>
</div>
</asp:Panel>
<asp:Panel ID="pnlAppealLodged" runat="server" Visible="false">
<div class="form-group">
<asp:Label ID="lblAppealLodged" runat="server" Font-Bold="True" Text="Appeal Lodged:" Width="320px"></asp:Label>
<asp:DropDownList ID="ddlAppealLodged" runat="server" AutoPostBack="True" CssClass="form-control-static" OnSelectedIndexChanged="ddlAppealLodged_SelectedIndexChanged" Width="220px">
<asp:ListItem Value="0"><-- Please Select --></asp:ListItem>
<asp:ListItem>Yes</asp:ListItem>
<asp:ListItem>No</asp:ListItem>
</asp:DropDownList>
</div>
</asp:Panel>
<asp:Panel ID="pnlAppealDate" runat="server" Visible="false">
<div class="form-group">
<asp:Label ID="lblAppealLodgedDate" runat="server" Font-Bold="True" Text="Date Appeal Lodged:" Width="320px"></asp:Label>
<asp:TextBox ID="txtDateLodged" runat="server" CssClass="form-control-static" Width="220px"></asp:TextBox>
<ajaxToolkit:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server" TargetControlID="txtDateLodged" WatermarkCssClass="txtwatermark" WatermarkText="dd/mm/yyyy" />
</div>
<asp:RegularExpressionValidator ID="regexDateAppealLodged" runat="server" ControlToValidate="txtDateLodged" Display="Dynamic" ErrorMessage="* Enter a valid Termination Date (DD/MM/YYYY)" font-bold="true" ForeColor="Red" ValidationExpression="^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$" ValidationGroup="PIP">*</asp:RegularExpressionValidator>
</asp:Panel>
<div class="form-group">
<asp:Label ID="lblVSSInterest" runat="server" Font-Bold="True" Text="VSS Interest Confirmed:" Width="320px"></asp:Label>
<asp:DropDownList ID="ddlVSS" runat="server" AutoPostBack="True" CssClass="form-control-static" OnSelectedIndexChanged="ddlVSS_SelectedIndexChanged" Width="220px">
<asp:ListItem Value="0"><-- Please Select --></asp:ListItem>
<asp:ListItem>Yes</asp:ListItem>
<asp:ListItem>No</asp:ListItem>
</asp:DropDownList>
<div>
<br />
<asp:Panel ID="pnlCRIType" runat="server" Visible="false">
<div class="form-group">
<asp:Label ID="lblCRIType" runat="server" Font-Bold="True" Text="CRI Type:" Width="320px"></asp:Label>
<asp:DropDownList ID="ddlCRIType" runat="server" CssClass="form-control-static" Width="220px">
<asp:ListItem Value="0"><-- Please Select --></asp:ListItem>
<asp:ListItem>Psychological</asp:ListItem>
<asp:ListItem>Physical</asp:ListItem>
<asp:ListItem>Psychological & Physical</asp:ListItem>
<asp:ListItem>Other</asp:ListItem>
</asp:DropDownList>
</div>
</asp:Panel>
<div class="form-group">
<asp:Label ID="lblDLATerminationDate" runat="server" Font-Bold="True" Text="DLA Termination Date:" Width="320px"></asp:Label>
<asp:TextBox ID="DLATerminationDateTextBox" runat="server" CssClass="form-control-static" MaxLength="10" Text='<%# Bind("DLATerminationDate") %>' Width="220px" />
<ajaxToolkit:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender2" runat="server" TargetControlID="DLATerminationDateTextBox" WatermarkCssClass="txtwatermark" WatermarkText="dd/mm/yyyy" />
<asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="DLATerminationDateTextBox" Display="Dynamic" ErrorMessage="* Enter a valid Termination Date (DD/MM/YYYY)" font-bold="true" ForeColor="Red" ValidationExpression="^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$" ValidationGroup="PIP">*</asp:RegularExpressionValidator>
<asp:RequiredFieldValidator ID="reqvalTerminationDate" runat="server" ControlToValidate="DLATerminationDateTextBox" Display="Dynamic" Enabled="False" ErrorMessage="DLA Termination Date Required" font-bold="true" ForeColor="Red" SetFocusOnError="True" ValidationGroup="PIP">*</asp:RequiredFieldValidator>
</div>
<br />
<div class="row text-center">
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" cssclass="btn btn-success" OnClick="InsertButton_Click" OnClientClick="changeTextPIP()" Text="Insert" ValidationGroup="PIP" Width="125px" />
<asp:Button ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" cssclass="btn" onclick="InsertCancelButton_Click" Text="Cancel" ValidationGroup="PIP" Width="125px" />
</div>
<br />
</div>
</div>
</InsertItemTemplate>

Textbox value in gridview in updatepanel

trying to get value from textbox called tbAantalgv in a gridview within an updatepanel after button click. standard value after databind for tbAantalgv = 0, but when i change the textbox value to 1, the textbox value will NOT change.
For Each gvr As GridViewRow In gvOnderdelenLos.Rows
If gvr.RowType = DataControlRowType.DataRow Then
Dim lblCode As Label = gvr.FindControl("lblCode")
Dim lblArtikel As Label = gvr.FindControl("lblArtikel")
Dim tbAantalgv As TextBox = gvr.FindControl("tbAantalgv")
End If
Next
<asp:UpdatePanel ID="pnlOnderdelenLos" runat="server" style="width:95%; border:solid 3px white; display:none;" UpdateMode="Conditional" >
<ContentTemplate>
<asp:ImageButton ID="imgOnderdelenLosToevoegen" runat="server" OnClientClick="imgOnderdelenLosToevoegen()" ImageUrl="~/Afbeeldingen/Icons/table_row_insert.png"
style="vertical-align:text-top; float:right; margin-right:2%" />
<asp:SqlDataSource ID="dsOnderdelenLos" runat="server" ConnectionString="<%$ ConnectionStrings:AftersalesConnectionString %>"
SelectCommand="EXEC spAppPnlOnderdelenLos">
</asp:SqlDataSource>
<asp:GridView ID="gvOnderdelenLos" runat="server" DataSourceID="dsOnderdelenLos" AllowSorting="False" PagerSettings-PageButtonCount="20" ShowHeader="false"
AllowEditing="True" AutoGenerateColumns="False" CellPadding="3" GridLines="Both" AllowPaging="False" style="width:100%; margin-left:2px;">
<HeaderStyle CssClass="Gridview" />
<Columns>
<asp:TemplateField HeaderText="Artikelnummer" SortExpression="Code" ItemStyle-Width="25%" >
<ItemTemplate>
<asp:Label ID="lblCode" runat="server" Text='<%# Bind("Code")%>' ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Artikel" SortExpression="Omschrijving" ItemStyle-Width="25%">
<ItemTemplate>
<asp:Label id="lblArtikel" runat="server" Text='<%# Bind("Omschrijving")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Aantal" SortExpression="Aantal" ItemStyle-Width="25%">
<ItemTemplate>
<asp:TextBox id="tbAantalgv" runat="server" Width="95%" text='<%# Bind("Aantal")%>'></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Kostenplaats" SortExpression="Kostenplaats" ItemStyle-Width="25%">
<ItemTemplate>
<asp:DropDownList ID="dlKostenplaats" runat="server" Width="100%">
<asp:ListItem Text="Werkplaats"></asp:ListItem>
<asp:ListItem Text="Verkoop"></asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Button ID="btnOnderdelenLosToevoegen" runat="server" OnClick="btnOnderdelenLosToevoegen_click" style="display:none;"/>
I do not understand what the issue can be.
Thanks in advance.
Frank

how to make the content inside div to display in one line

I have 4 labels inside a div, it looks like this:
I want them to display in one single line, how do I do this?
The code for labels:
<div style="float:left; width:50%">
<asp:UpdatePanel ID="loginPanel" runat="server" UpdateMode="Always">
<ContentTemplate>
<asp:Label ID="LoginLabel" runat="server" CssClass="label-info" Font-Bold="true" ForeColor="White" Width="300px"/>
</ContentTemplate>
</asp:UpdatePanel>
<%--Login ID--%>
<asp:UpdatePanel ID="RolePanel" runat="server" UpdateMode="Always">
<ContentTemplate>
<asp:Label ID="ShowRole" runat="server" CssClass="label-info" Font-Bold="true" ForeColor="White" Width="300px"/>
</ContentTemplate>
</asp:UpdatePanel>
<%-- role --%>
<asp:UpdatePanel ID="timePanel" runat="server" UpdateMode="Always">
<ContentTemplate>
<asp:Label ID="ShowTime" runat="server" CssClass="label-info" Font-Bold="true" ForeColor="White" Width="300px"/>
</ContentTemplate>
</asp:UpdatePanel>
<%--<br />--%>
<asp:UpdatePanel ID="projPanel" runat="server" UpdateMode="Always">
<ContentTemplate>
<asp:Label ID="ProjCount" runat="server" CssClass="label-info" Font-Bold="true" ForeColor="White" Width="300px"/> <%--project counter--%>
</ContentTemplate>
</asp:UpdatePanel>
</div>
I don't know with asp.net, but with a single css :
.label-info{
display : inline-block;
float : left;
}
It appears the part that has
<%--<br />--%>
is breaking the line apart. Once changing that, the CSS bit display: inline-block; will do the trick.
Please use following css property, because <asp:label/> gets rendered as <div>.
div.lable-info{
display:inline;
}