Doubts on DataGrid Hyperlink Column
I'm into an asp.net application with C# as code behind.
à à à I have used DataGrid control to display a set of records as below:
à à (Data populated from SQL Server SP & is bounded with DataGrid)
à à The code goes like this:
<asp:DataGrid ID="dgRep" runat="server" AutoGenerateColumns="False" Width="100%" OnItemDataBound="dgRep_ItemDataBound">
<AlternatingItemStyle CssClass="alt_items" />
<ItemStyle CssClass="items" />
à à <Columns>
<asp:HyperLinkColumn DataTextField="name"Ã Ã DataNavigateUrlField=" name" DataNavigateUrlFormatString="~/Admin/Summary01.aspx?na={0}">
<ItemStyle HorizontalAlign="Left" />
</asp:HyperLinkColumn>
à à <asp:BoundColumn DataField="amount" DataFormatString="{0:C}">
<ItemStyle HorizontalAlign="Right" />
</asp:BoundColumn>
à à .....
</Columns>
<FooterStyle Font-Bold="False" />
</asp:DataGrid>
******************************************
name amount Perc count
******************************************
[u]ABC</u> 1000 11.4 15
[u]XYZ</u> 2000 22.8 20
[u]L&T</u> 500 5.7 7
[u]Others</u> 35500 45.7 147
Here i need two things:Ã Ã
1.Ã Ã On the first column, I dont need hyperlink on the name field of last row - "Others".Ã Ã Ã
- how to remove link only for that value? need to do some coding on code behind file. if so, what?
2.Ã Ã when i click hyperlink under name column, the page will be navigated to another page with clicked value as querystring. (ref: na={0})
à Here, if i click a data with "&", (ex. L&T) the querystring value got terminated before "&", so how can i put "Server.URLEncode" on the name column?
Expecting your positive reply.
Thanks in Advance.
Best Regards,
Saran.
__________________
Best Regards,
Saran.
|