|
U can use group name property otherwise post the code....
|
|
|
|
|
|
Ahish JV wrote: asp:RadioButton id="rd1" runat="server" in a template column
Add common Groupname to each radio button
group="name" which is the property for the radio button
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
I have done same but with check box.
This is the code to read Gridview rows:
Private Function ReadGridRows() As String
Dim intGridRowcnt As Int16
Dim strFinalString As String = ""
Try
For intGridRowcnt = 1 To GridViewForm.Rows.Count
strFinalString = strFinalString & GridViewForm.DataKeys(intGridRowcnt - 1).Item("FormID").ToString & ","
'strFinalString = strFinalString & GridViewForm.Rows(intGridRowcnt).RowIndex & ","
If CType(GridViewForm.Rows(intGridRowcnt - 1).FindControl("chkAdd"), CheckBox).Checked Then
strFinalString = strFinalString & "A"
Else
strFinalString = strFinalString & "X"
End If
If CType(GridViewForm.Rows(intGridRowcnt - 1).FindControl("chkModify"), CheckBox).Checked Then
strFinalString = strFinalString & "M"
Else
strFinalString = strFinalString & "X"
End If
If CType(GridViewForm.Rows(intGridRowcnt - 1).FindControl("chkDelete"), CheckBox).Checked Then
strFinalString = strFinalString & "D"
Else
strFinalString = strFinalString & "X"
End If
If CType(GridViewForm.Rows(intGridRowcnt - 1).FindControl("chkView"), CheckBox).Checked Then
strFinalString = strFinalString & "V"
Else
strFinalString = strFinalString & "X"
End If
If CType(GridViewForm.Rows(intGridRowcnt - 1).FindControl("chkPrint"), CheckBox).Checked Then
strFinalString = strFinalString & "P"
Else
strFinalString = strFinalString & "X"
End If
strFinalString = strFinalString & "," & IIf(CType(GridViewForm.Rows(intGridRowcnt - 1).Cells(7).Text, Boolean) = True, 1, 0)
strFinalString = strFinalString & "/"
Next
'
Return strFinalString
Catch ex As Exception
Return ""
End Try
End Function
|
|
|
|
|
Are you writing whole code Varsha
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
what is this button for???
The code which u have given works fine but I didnt get y u r using button???
|
|
|
|
|
Use this link to change ur code from VB to C# :
http://www.developerfusion.co.uk/Utilities/convertcsharptovb.aspx
Hope it helps u...
|
|
|
|
|
I think this may help U.
Click Here
Regards,
Arun kumar.A
|
|
|
|
|
One Post is enough.
Regards,
Satips.
|
|
|
|
|
I implement a feature for a website, and use openModelWindow() to open another browser to choose a date. it works well in IE, but the firefox, it never comes.
is there any solution for that? Thanks
Wilson
|
|
|
|
|
The solution is not to use it.
openModalWindow is a non-standard method that only exists in Internet Explorer. If you don't want to make IE specific applications, stick to the standards.
---
single minded; short sighted; long gone;
|
|
|
|
|
IE is not w3 Compliant in true sence
You need to take care of your script it should not contain against this specifications
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Thanks very much!
Hoa Ho Hoa Bi Nan Hoa Cot
Tri Nhan Tri Dien Bat Tri Tam
|
|
|
|
|
|
Hi All,
I need to show empty GirdView, I mean when dataset is empty girdview should show only column with no rows.
Please help me...
Thanks in advance...
|
|
|
|
|
I am not sure of the right method.
But U can try this.
Using System.Collections;
if (grid.Rows.Count==0)
{
ArrayList arr=new ArrayList ();
arr.add("");
arr.add("");
arr.add("");
//and so on(now 3 empty rows will be displayed).
grid.DataSource=arr;
grdi.DataBind();
}
Hope this helps U.
Regards,
Arun Kumar.A
|
|
|
|
|
Thanks Arun,
But its not working. Its gives run time error saying
DataBinding: 'System.String' does not contain a property with the name 'LoanPayOffID'.
Where LoanPayOffID is primary Key.
Please help...
|
|
|
|
|
Try Using this..
if (ds.Tables[0].Rows.Count == 0)
{
ds.Tables[0].Rows.Add("", ""); //Add empty string that corresponds to the number of columns
grdOrders.DataSource = ds.Tables[0];
grdOrders.DataBind();
grdOrders.Rows[0].Visible = false;
}
Regards,
Arun Kumar.A
|
|
|
|
|
The gridview has an emptydatarowtext that you can use to display some text or you can use the emptydatarowtemplate to display some html.
Hope that helps.
Ben
|
|
|
|
|
Thanks Kubben,
I need to display empty Gridview, I dont want to display a text message saying to record present.I want if dataset has no rows then Girdview should display with only column names.
Please help...
Thanks again...
|
|
|
|
|
That is what you can use the emptygridviewtemplate for. I suggest running you app when you have data in the gridview. Go to the browser view - source, copy the html code. Paste it into a emptygridviewtemplate. Remove the data, just leave the header. You should be all set.
Ben
|
|
|
|
|
Where do I put emptygridviewtemplate, this is my gridview and when I fire my query it reurns dataset which has no rows.
Tell me how do I do this...
<asp:GridView ID="GridViewLoanPayOff" runat="server" AutoGenerateColumns="False" Width="1200px" HorizontalAlign="left">
<RowStyle CssClass="GridRowColor" />
<AlternatingRowStyle CssClass="GridAlternateRowColor" />
<Columns>
<asp:BoundField DataField="LoanPayOffID" Visible="False"/>
<asp:BoundField DataField="BankName" HeaderText="Bank Name" HeaderStyle-CssClass="heading">
<ItemStyle Width="150px" />
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="200px" />
</asp:BoundField>
<asp:BoundField DataField="BranchLocation" HeaderText="Branch Location" HeaderStyle-CssClass="heading">
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="160px" />
</asp:BoundField>
<asp:BoundField DataField="PhoneNo" HeaderText="Phone #" HeaderStyle-CssClass="heading">
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="220px" />
</asp:BoundField>
<asp:BoundField DataField="FaxNo" HeaderText="Fax #" HeaderStyle-CssClass="heading">
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="80px" />
</asp:BoundField>
<asp:BoundField DataField="ETA" HeaderText="ETA" HeaderStyle-CssClass="heading">
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="80px" />
</asp:BoundField>
<asp:BoundField DataField="BorrowerAutherization" HeaderText="BA" HeaderStyle-CssClass="heading">
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="80px" />
</asp:BoundField>
<asp:BoundField DataField="OfficeTime" HeaderText="Office Hours " HeaderStyle-CssClass="heading">
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="250px" />
</asp:BoundField>
<asp:BoundField DataField="WorkingDays" HeaderText="Working Days" HeaderStyle-CssClass="heading">
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="130px" />
</asp:BoundField>
<asp:BoundField DataField="IsAutomatedSystem" HeaderText="IVR/Automated" HeaderStyle-CssClass="heading">
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="120px" />
</asp:BoundField>
<asp:BoundField DataField="Remarks" HeaderText="Remarks" HeaderStyle-CssClass="heading">
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="90px" />
</asp:BoundField>
<asp:TemplateField HeaderText="Edit" HeaderStyle-CssClass="heading">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
<ItemTemplate>
<asp:ImageButton Runat="server" ID="Edit" ImageAlign=Middle CommandName="Edit" ToolTip="Edit" CssClass="cursor" ImageUrl="../images/edit.jpg"></asp:ImageButton>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" Width="50px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Delete" HeaderStyle-CssClass="heading">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
<ItemTemplate>
<asp:ImageButton Runat="server" ID="Delete" CommandName="DeleteTrans" ToolTip="Delete" CssClass="cursor" ImageUrl="../Images/delete.gif">
</asp:ImageButton>
</ItemTemplate>
<HeaderStyle Width="60px" />
</asp:TemplateField>
</Columns>
</asp:GridView>
|
|
|
|
|
I guess I gave you the wrong name. It is emptydataTemplate. It goes in the gridview. Here is a link:
<a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.emptydatatemplate.aspx">http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.emptydatatemplate.aspx</a>[<a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.emptydatatemplate.aspx" target="_blank" title="New Window">^</a>]
The basics are:
right before the </asp:GridView> tag you need
<EmptyDataTemplate>
put your html here
</EmptyDataTemplate>
</asp:GridView>
Hope that helps.
Ben
|
|
|
|
|
He is asking what to write in the place where U have written
"put your html here".
Please run the application in such a way that the grid shows data.
Open the Page source from IE or FF.
Locate the tag
<Table>
and copy the first row with tr and th tags.
Paste them in that place.
Arun Kumar.A
|
|
|
|
|
Thanks Kubben, its working now I took help form the following link:
http://www.codeproject.com/useritems/Fix_empty_GridView_issue.asp
Thanks again...
|
|
|
|