Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: DataGrid Control


Message #1 by Leena Natekar <paradise_flycatcher@y...> on Thu, 14 Jun 2001 04:25:38 -0700 (PDT)
Here is an example of how I use it in a datagrid (see ItemTemplate).  Please
note that I add many other columns programatically.  Also, I sometimes hide
the hyperlinks through code as well.

HTH,
Michael


 <asp:DataGrid id="grdData" runat="server" Width="100%"
AutoGenerateColumns="False" allowsorting="True"
OnSortCommand="OnSortCommandDataGrid"
OnItemDataBound="grdData_ItemDataBound" AllowPaging="True"
OnPageIndexChanged="OnPageIndexChangedDataGrid" cssclass="Font"
forecolor="Black" cellpadding="2" borderstyle="None" gridlines="None" >
 <property name="PagerStyle"><asp:DataGridPagerStyle VerticalAlign="Middle"
NextPageText="Next Page >>" PrevPageText="<< Prev Page" BorderStyle="None"
HorizontalAlign="Right" ForeColor="Blue" Position="Top"
CssClass="Font"></asp:DataGridPagerStyle></property>
 <property name="AlternatingItemStyle"><asp:TableItemStyle BorderWidth="1px"
BorderStyle="Solid" BorderColor="Silver"
BackColor="#EFEFEF"></asp:TableItemStyle></property>
 <property name="EditItemStyle"><asp:TableItemStyle BorderWidth="1px"
BorderStyle="Solid" BorderColor="Silver"></asp:TableItemStyle></property>
 <property name="HeaderStyle"><asp:TableItemStyle Height="20px"
ForeColor="White" CssClass="TableHeader"></asp:TableItemStyle></property>
 <property name="Columns"><asp:TemplateColumn HeaderText="Action">
  <template name="ItemTemplate">
  <asp:HyperLink id=hypOpen runat="server" Text="Open" NavigateUrl='<%#
DataBinder.Eval(Container.DataItem, "Bui__iBuilderID",
"dm__builder_editor.aspx?Bui__iBuilderID={0}") %>'></asp:HyperLink>
  <font color="#0000FF"><asp:Label id="lblActionSeparator" Text=" | "
runat=server/></font>
  <asp:HyperLink id=hypDel onClick="return confirm('Are you sure you want to
permenantly DELETE this Builder?');" runat="server" Text="Del"
NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "Bui__iBuilderID",
"dm__builder_list.aspx?Bui__iBuilderID={0}") %>'></asp:HyperLink>
  </template>
 </asp:TemplateColumn>
 </property>
 </asp:DataGrid>

-----Original Message-----
From: Leena Natekar [mailto:paradise_flycatcher@y...]
Sent: Thursday, June 14, 2001 6:26 AM
To: ASPX_Professional
Subject: [aspx_professional] DataGrid Control


Hi,
I am trying to use the DataGrid web control, and I
need one of the columns to have  HyperLink. The Online
Documentation says - "It is yet to be supplied!!" .

Is there a work around? How can I achieve the same?

thanks,
regards,
Leena


  Return to Index