I inherited an asp.net web page that has a gridview control and an html button on each row in the gridview. I added "onserverclick" so that I could do some stuff at the server when this button is clicked. I can't use the asp button control because the manager wants it this way.
The end result is that I want to set the selected value of a dropdownlist control with a value from the gridview row. I got this working.
Now the problem. I am using an ajax ModalPopupExtender to display a panel as a popup window. But since I added the onservercontrol event, the popup now never displays. If I take off the onserverclick then the popup displays again but then I can't set my dropdownlist aelected value correctly.
I read something about having to do an ajax post. But not sure how to do that. I can post my html and C# code. Let me know what you need to see.
Trey,
Here is the html for my gridview control:
<asp:GridView CssClass="gridClass"
AlternatingRowStyle-CssClass="gridAlternateItem"
ID="gvMessage"
HeaderStyle-CssClass="gridHeader"
runat="server"
Width="98%"
ShowHeader="true"
AutoGenerateColumns="false"
AllowPaging="true"
AllowSorting="true"
PageSize="25"
PagerStyle-BackColor="#006699"
PagerStyle-ForeColor="White"
CellPadding="0"
CellSpacing="0"
OnPageIndexChanging="gvMessage_PageIndexChanging"
OnRowDataBound="gvMessage_RowDataBound"
OnSorting="gvMessage_Sorting"
OnSelectedIndexChanged="gvMessage_SelectedIndexChanged">
<Columns>
<asp:TemplateField ItemStyle-Height="20px" HeaderText="Task Date" SortExpression="DATE" HeaderStyle-ForeColor="white">
<ItemStyle Width="15%" HorizontalAlign="Left" CssClass=" gridRow" Wrap="false"/>
<ItemTemplate>
<asp:Label ID="lblDate" runat="server" Text='<%#Eval("Date")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Height="20px" HeaderText="Patient Name" SortExpression="Patient Chart" HeaderStyle-ForeColor="white">
<ItemStyle Width="15%" HorizontalAlign="Left" CssClass=" gridRow" Wrap="false"/>
<ItemTemplate>
<asp:Label ID="lblPatientChart" runat="server" Width="100%"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Staff</HeaderTemplate>
<ItemStyle Width="15%" HorizontalAlign="Left" CssClass="gridRow" />
<ItemTemplate>
<asp:Label ID="lblStaff" runat="server" Width="100%"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Height="20px" HeaderText="Task Type" SortExpression="Message Type" HeaderStyle-ForeColor="white">
<ItemStyle Width="30%" HorizontalAlign="Left" CssClass=" gridRow" Wrap="false"/>
<ItemTemplate>
<asp:Label ID="lblTaskType" runat="server" Width="100%"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderStyle Width="10%" />
<ItemStyle Width="10%" CssClass="gridRow" />
<HeaderTemplate>
Task Notes</HeaderTemplate>
<ItemTemplate>
<input type="button" runat="server" id="btnTaskNotes" name="ADD" class="button" value="Note" style="width: 100px" onserverclick="OnServerClick"/>
<%--<input type="button" runat="server" id="btnTaskNotes" name="ADD" class="button" value="Note" style="width: 100px"/> --%>
<input type="hidden" runat="server" id="hidFkid" />
<input type="hidden" runat="server" id="hidPhysManagementId" />
<input type="hidden" runat="server" id="hidComments" />
<input type="hidden" runat="server" id="hidClinicalNote" />
<input type="hidden" id="hidPkPhoneId" runat="server" />
<input type="hidden" runat="server" id="hidFK_Practitioner_Id" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Height="20px" HeaderText="Delete" HeaderStyle-ForeColor="white">
<ItemStyle Width="10%" HorizontalAlign="Center" CssClass=" gridRow" Wrap="false"/>
<HeaderTemplate>
<input type=checkbox id="chkDeleteAll" runat=server onclick="CheckAll(this.id)"/>
<input type=button id="btnDelete" runat=server value="Delete" class="classButton" style="width: 60%;" onclick="DeleteMsg();"/></HeaderTemplate>
<ItemTemplate>
<input type=checkbox id="chkDelete" runat=server />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lblFK_Practitioner_Id" runat="server" Visible="false" Text='<%#Eval("FK_Practitioner_Id")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
What else do you need to for me to post?
Related
I have an update panel that includes a gridview with two buttons and a modal popup. When the user clicks btnView, the modal popup appears displaying the relevant information.
My issue is that I have been trying to get the updateprogress to appear during the partial postback and so far have not managed it. I should mention that the same UpdateProgress code does work in a test page that just comprises of a button with a sleep function in the code behind. Here is the html:
<!-- Placing the GridView in UpdatePanel-->
<asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="gv" />
</Triggers>
<ContentTemplate>
<asp:GridView ID="gv" runat="server" AutoGenerateColumns="False" DataKeyNames="GroupID" GridLines="Both"
BorderWidth="1px" CellPadding="2" ForeColor="Black" OnRowDataBound="gv_RowDataBound" BorderStyle="Double" HorizontalAlign="Center"
HeaderStyle-HorizontalAlign="Center" AllowSorting="True" CssClass="gvformat">
<AlternatingRowStyle BackColor="#95B9B9" />
<HeaderStyle BorderStyle="Double" BorderColor="Black"/>
<Columns>
<asp:BoundField DataField="FinancialYear" HeaderText="Financial Year" ItemStyle-HorizontalAlign="Center"/>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Button ID="btnView" runat="server" Text="view" OnClick="btnComments_Click" CausesValidation="false" Font-Names="Trebuchet MS" CssClass="btn btn-info" Font-Bold="True" />
</ItemTemplate>
<HeaderTemplate>Comment</HeaderTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle">
<ItemTemplate>
<asp:Button ID="btnDetail" runat="server" Text="view" OnClick="btnDetails_Click" CausesValidation="false" Font-Names="Trebuchet MS" CssClass="btn btn-comment" ForeColor="White" Font-Bold="True" />
</ItemTemplate>
<HeaderTemplate>Details</HeaderTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Button ID="bttnHidden" runat="Server" Style="display: none" />
<br />
<asp:Panel ID="pnlComment" runat="server" Width="650px" Height="620px" Style="display: none;" CssClass="modalBox">
<table border="1" class="commentTable" style="border-collapse: separate; border-spacing: 10px; width:100%; height:100%">
<tr><th><asp:Label ID="lblComments" runat="server" Text="Comments" Font-Size="Medium"></asp:Label></th></tr>
<tr><td>
<asp:TextBox ID="txtExistingComments" runat="server" TextMode="MultiLine" ReadOnly="True" CssClass="content" Rows="12" Font-Names="Trebuchet MS"></asp:TextBox>
</td></tr>
<tr><th><asp:Label ID="lblNewComment" runat="server" Text="Add Comment" Font-Size="Medium"></asp:Label></th></tr>
<tr><td>
<asp:TextBox ID="txtNewComments" runat="server" TextMode="MultiLine" ReadOnly="False" CssClass="content" Rows="12" Font-Names="Trebuchet MS"></asp:TextBox></td></tr>
<tr><td>
<asp:Button ID="btnSave" runat="server" width="100px" Text="Save" OnClick="btnSave_Click" CssClass="btn btn-comment" ValidationGroup="SaveComment" ForeColor="White" Font-Bold="True" />
<asp:Button ID="btnCancel" runat="server" width="100px" Text="Cancel" CssClass="btn btn-comment" ForeColor="White" Font-Bold="True"/></td></tr>
<tr>
<td>
<asp:RequiredFieldValidator ID="rfValidator" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="txtNewComments"
ForeColor="Black" ValidationGroup="SaveComment" Font-Bold="True">You must enter a comment!</asp:RequiredFieldValidator>
</td>
</tr>
</table>
</asp:Panel>
<cc1:ModalPopupExtender ID="modal" runat="server" TargetControlID="bttnHidden" PopupControlID="pnlComment" CancelControlID="btnCancel" BackgroundCssClass="modalBackground"></cc1:ModalPopupExtender>
<br />
<asp:HiddenField ID="Hidden" runat="server" value="-1"/>
<asp:HiddenField ID="bStatus" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1" ChildrenAsTriggers="false" UpdateMode="Conditional" DisplayAfter="10">
<ProgressTemplate>
<div class="center">
<asp:Image ID="imgUpdateProgress" runat="server" ImageUrl="~/Images/loader.gif" AlternateText="Please wait ..." ToolTip="Please wait ..." />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</asp:Content>
Any help would be most appreciated!
two points you need to check.
First if you have any javascript errors - this Update Progress is base on javascrip, so any javascript error can stop the function of it. Open the console panel and check for javascript errors...
The second point is to check the DisplayAfter property on UpdateProgress, that is 500 milliseconds default value. If anything happens within this time, the UpdateProgress is not show. So add a lower value on DisplayAfter to check it out.
I'm trying to use the events on my Gridview control. But its not firing the events when expected. i.e, for OnSelectedIndexChanged, when changing the selected cell/row nothing happens. I've tried with OnSelectedIndexChanged as well as OnRowUpdating. The breakpoint is never hit in gvQ15_RowUpdating. I've even tried using the OnTextChanged event for the child textboxes or the gridview and they are not firing.
Markup
<asp:GridView AutoPostBack="true" ID="gvQ15" runat="server" AllowPaging="false" AutoGenerateColumns="false" >
<Columns>
<asp:TemplateField HeaderText="Prescription Medication Name" ItemStyle-Width="25%">
<ItemTemplate>
<asp:TextBox ID="txtPrescriptionMedicationName" runat="server" Width="100%" OnTextChanged="txtPrescriptionMedicationName_TextChanged" BordewWidth="0" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Date Originally Prescribed" ItemStyle-Width="10%">
<ItemTemplate>
<asp:TextBox ID="txtDateOriginallyPrescribed" runat="server" Style="min-width: 110px; width: 100%;" BorderWidth="0" OnTextChanged="txtDateOriginallyPrescribed_TextChanged" />
<asp:MaskedEditExtender ID="meetxtDateOriginallyPrescribed" runat="server" MaskType="date" UserDateFormat="MonthDayYear" Mask="99/99/9999" TargetControlID="txtDateOriginallyPrescribed" ClearMaskOnLostFocus="true" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Frequency and Dosage" ItemStyle-Width="25%">
<ItemTemplate>
<asp:TextBox ID="txtFrequencyAndDosage" runat="server" Width="100%" BorderWidth="0" OnTextChanged="txtFrequencyAndDosage_TextChanged" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Condition" ItemStyle-Width="25%">
<ItemTemplate>
<asp:TextBox ID="txtCondition" runat="server" Width="100%" BorderWidth="0" OnTextChanged="txtCondition_TextChanged" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Onset Date" ItemStyle-Width="10%">
<ItemTemplate>
<asp:TextBox ID="txtConditionOnsetDate" runat="server" style="min-width:110px;width:100%" BorderWidth="0" OnTextChanged="txtConditionOnsetDate_TextChanged" />
<asp:MaskedEditExtender ID="meeConditionOnsetDate" runat="server" MaskType="date" UserDateFormat="MonthDayYear" Mask="99/99/9999" TargetControlID="txtConditionOnsetDate" ClearMaskOnLostFocus="true" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Code Behind
Protected Sub gvQ15_RowUpdating(sender As Object, e As GridViewUpdateEventArgs)
Session("Prescriptions") = gvQ15.DataSource
End Sub
Add the CausesValidation="False" attribute to your CommandField.
<asp:commandfield ShowEditButton="True" CausesValidation="False" HeaderText="Edit"/>
Or,
Add the EnableViewState="True" attribute to your GridView.
For TemplateField use this:
<asp:TemplateField HeaderText="Command">
<ItemTemplate>
<asp:Button CommandName="Edit" Text="Edit" ID="btnEdit" Runat="server"></asp:Button>
<asp:Button CommandName="Delete" Text="Delete" ID="btnDel" Runat="server"></asp:Button>
</ItemTemplate>
<EditItemTemplate>
<asp:Button CommandName="Update" Text="Update" ID="btnUpdate" Runat="server"></asp:Button>
<asp:Button CommandName="Cancel" Text="Delete" ID="btnCancel" Runat="server"></asp:Button>
</EditItemTemplate>
</asp:TemplateField>
The attached screenshot shows two images.
Is it possible to make to Add button and delete button align side by side as depicted by the bottom image?
We are currently using GridView to create dynamic rows and it gets bit too long helped in part by the position of the Add button
<asp:gridview ID="grvCustomers" GridLines="None" runat="server" ShowFooter="true" AutoGenerateColumns="false" OnRowDeleting="grvCustomers_RowDeleting">
<Columns>
<asp:BoundField DataField="RowNumber" Visible="false" HeaderText="Row Number" />
<asp:TemplateField HeaderText="Customer Name">
<ItemTemplate>
<asp:TextBox ID="custname" runat="server" style="width:250px;" class="form-control"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Adress">
<ItemTemplate>
<asp:TextBox ID="custaddress" runat="server" style="width:250px;" class="form-control"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Amount">
<ItemTemplate>
<asp:TextBox ID="custamount" runat="server" style="width:250px;" class="form-control"></asp:TextBox>
</ItemTemplate>
<FooterStyle HorizontalAlign="Right" />
<FooterTemplate>
<asp:Button ID="ButtonAdd" runat="server" Text="Add More"
onclick="ButtonAdd_Click" />
</FooterTemplate>
</asp:TemplateField>
<asp:CommandField ShowDeleteButton="True" />
</Columns>
</asp:gridview>
I second what #ahwm said.
But also, if the goal is to add the record to the data source, couldn't you simply add the commandfield showinsertbutton="true".
I am implementing the functionality that on button click the data saved in the gridview should get exported on the button click, I implemented the functionality from here.
But I am getting error as Control 'mainContent_grdTeacherProfile' of type 'GridView' must be placed inside a form tag with runat=server at line
grdTeacherProfile.RenderControl(hw);
Please see the asps code of the gridview:-
<asp:GridView ID="grdTeacherProfile"
runat="server"
Width="100%"
border="1" Style="border: 1px solid #E5E5E5;"
CellPadding="3" FooterStyle-BackColor="#e3e3e3"
AutoGenerateColumns="false"
AllowPaging="true"
CssClass="hoverTable"
DataKeyNames="Id"
PageSize="4"
ShowFooter="false"
OnPreRender="PreRenderGrid"
HeaderStyle-CssClass="k-grid td"
OnDataBound="grdTeacherProfile_DataBound"
OnPageIndexChanging="grdTeacherProfile_PageIndexChanging"
OnRowDeleting="grdTeacherProfile_RowDeleting"
OnRowCommand="grdTeacherProfile_RowCommand"
EnableSortingAndPagingCallbacks="false"
EmptyDataText="No records found">
<AlternatingRowStyle CssClass="k-alt" />
<Columns>
<asp:TemplateField HeaderText="Select" ItemStyle-Width="5" >
<ItemTemplate>
<asp:CheckBox ID="chkDelete" runat="server" onClick="Check_Click(this)" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="first_name" HeaderText="First Name" ItemStyle-Width="30" />
<asp:BoundField DataField="last_name" HeaderText="Last Name" ItemStyle-Width="30" />
<asp:BoundField DataField="dob" HeaderText="Date of Birth" ItemStyle-Width="20" ApplyFormatInEditMode="true" DataFormatString="{0:d}" />
<asp:BoundField DataField="gender" HeaderText="Gender" ItemStyle-Width="20" />
<asp:BoundField DataField="designation" HeaderText="Designation" ItemStyle-Width="20" />
<asp:BoundField DataField="joining_date" HeaderText="Joining Date" ItemStyle-Width="20" ApplyFormatInEditMode="true" DataFormatString="{0:d}" />
<asp:BoundField DataField="leaving_date" HeaderText="Leaving Date" ItemStyle-Width="20" ApplyFormatInEditMode="true" DataFormatString="{0:d}" />
<asp:BoundField DataField="active" HeaderText="Active" ItemStyle-Width="25" />
<asp:TemplateField HeaderText="Action" HeaderStyle-Width="5%">
<ItemTemplate>
<asp:ImageButton ID="btnEdit" AlternateText="Edit" ImageUrl="~/images/edit.png" runat="server" Width="15" Height="15" CommandName="eEdit" CommandArgument='<%# Eval("Id") %>' CausesValidation="false" />
<asp:ImageButton ID="btnDelete" AlternateText="Delete" ImageUrl="~/images/delete.png" runat="server" Width="15" Height="15" CommandName="Delete" CommandArgument='<%# Eval("Id") %>' CausesValidation="false" OnClientClick="return confirm('Are you sure you want to delete this record?')" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<PagerStyle ForeColor="#e3e3e3"
BackColor="#e3e3e3" CssClass="grid-pagi" />
<PagerTemplate>
<table runat="server" id="testTable1" style="width: 100%" class="hoverTable_tbl">
<tr>
<td class="col-md-4 pull-left">
<asp:Label ID="MessageLabel"
Text="Select a page:"
runat="server" />
<asp:LinkButton ID="FirstLB" runat="server" CommandName="Page" CommandArgument="First" ToolTip="First" CssClass="btn-pager btn-default"><<</asp:LinkButton>
<asp:LinkButton ID="PrevLB" runat="server" CommandName="Page" CommandArgument="Prev" ToolTip="Previous" CssClass="btn-pager btn-default"><</asp:LinkButton>
<asp:DropDownList runat="server" ID="PageDropDownList" AutoPostBack="true" EnableViewState="true" OnSelectedIndexChanged="PageDropDownList_SelectedIndexChanged" CssClass="selectpicker form-control-drp"></asp:DropDownList>
<asp:LinkButton ID="NextLB" runat="server" CommandName="Page" CommandArgument="Next" ToolTip="Next" CssClass="btn-pager btn-default">></asp:LinkButton>
<asp:LinkButton ID="LastLB" runat="server" CommandName="Page" CommandArgument="Last" ToolTip="Last" CssClass="btn-pager btn-default">>></asp:LinkButton>
</td>
<td class="col-md-3">
<div>
<div class="pull-left"><asp:Label ID="PageSizeLabel" CssClass="page-size" runat="server" Text="Select Page Size: "></asp:Label>
<asp:DropDownList ID="ddlPageSize" runat="server" OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged" AutoPostBack="true" CssClass="selectpicker form-control-drp">
<%-- <asp:ListItem Value="0" Text="0" />--%>
<asp:ListItem Value="1" Text="1" />
<asp:ListItem Value="2" Text="2" />
<asp:ListItem Value="3" Text="3" />
</asp:DropDownList>
</div>
<div>
<asp:Label ID="CurrentPageLabel" CssClass="view" runat="server" />
</div>
</div>
</td>
</tr>
</table>
</PagerTemplate>
<RowStyle />
</asp:GridView>
Exporting GridView to Excel is easier using a 3rd party like iTextSharp.
If you want to know how I make it work, you can check this sample code:
http://dotnetfrommanila.blogspot.com/2013/04/convert-gridview-to-excel-in-c.html
I hope it could help you.
I got it done on my own,
actually I forgot to add the code below and EnableEventValidation="false".
The code was:-
public override void VerifyRenderingInServerForm(Control control)
{
/* Verifies that the control is rendered */
}
and it worked.!!
here I'm trying to make a scroll-able Grid View, which I did using the overflow, but the problem is, I want to make the Header section static, allowing only the content to be scrolled, here's my code:
<div class="BodyDiv" style="overflow: auto; height: 200px">
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<table width="1024px">
<tr>
<td align="center">
<table width="980px">
<tr>
<td>
<asp:Panel ID="PanelDGV" runat="server" Height="250" ScrollBars="None" Width="515">
<asp:GridView ID="DGV" runat="server" AutoGenerateColumns="False" GridLines="None" AllowPaging="true" PageSize="50" CssClass="mGrid" PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt">
<Columns>
<asp:BoundField DataField="ProjectCode" HeaderText="Project Code" />
<asp:BoundField DataField="ProjectName" HeaderText="Project Name" />
<asp:ButtonField ButtonType="Image" ImageUrl="../Support/Image/Edit.png" ItemStyle-HorizontalAlign="Center"
CommandName="CmdSearch" HeaderText="Edit">
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:ButtonField>
</Columns>
<PagerStyle CssClass="pgr"></PagerStyle>
<AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
</asp:GridView>
</asp:Panel>
</td>
</tr>
</table>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
is there anyway to do it? thank you.
<script src="../Scripts/ScrollableGridPlugin.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$('#<%=Grd.ClientID %>').Scrollable();
}
)
You can download this js file from below url
http://code.google.com/p/dev-acuaman/source/browse/trunk/PyproduceEstad%C3%ACstica/EstadisticaProduce/Scripts/ScrollableGridPlugin.js?r=79
<asp:GridView ID="Grd" runat="server" Width="100%" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField HeaderText="Country">
<ItemTemplate>
<asp:Label ID="lbl" runat="server" Text='<%# Eval("CountryName") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Enter Shipping Charge">
<ItemTemplate>
<asp:TextBox ID="txt" runat="server" Text='<%# Eval("charge") %>'></asp:TextBox>
<asp:CompareValidator ID="CompareValidator2" runat="server" ControlToValidate="txt"
ValidationGroup="txt" SetFocusOnError="true" Operator="DataTypeCheck" Type="Double"
ErrorMessage="Country Wise Shipping Charge must be number!">*</asp:CompareValidator>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="160px" VerticalAlign="Middle" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Enter No Of Days">
<ItemTemplate>
<asp:TextBox ID="txt1" runat="server" Text='<%# Eval("days") %>'></asp:TextBox>
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="txt"
ValidationGroup="txt1" SetFocusOnError="true" Operator="DataTypeCheck" Type="Integer"
ErrorMessage="No Of Days must be number!">*</asp:CompareValidator>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="160px" VerticalAlign="Middle" />
</asp:TemplateField>
</Columns>
</asp:GridView>