Hi..
I have a radgrid with a column that I'm entering a reference number that I wish to use to extract a corresponding row value. This reference value is not required to be stored so I only need to access the entry whilst the cells are in edit mode (red updated symbol) I wish to use the extracted value to plot a route via google maps.. and the reference will be a number corresponding to the waypoint order. How can I extract a list of strings of postcode column based on numerical value / null value in map column.
<telerik:RadGrid ID="RadGrid1" GridLines="None" runat="server" AllowPaging="True" PageSize="10" EnableViewState="True"
AutoGenerateColumns="False" OnNeedDataSource="RadGrid1_NeedDataSource" OnItemUpdated="RadGrid1_ItemUpdated"
OnItemDeleted="RadGrid1_ItemDeleted" OnItemInserted="RadGrid1_ItemInserted" OnDataBound="RadGrid1_DataBound"
OnItemCommand="RadGrid1_ItemCommand" OnItemDataBound="RadGrid1_ItemDataBound"
CellSpacing="0" Skin="Windows7">
<PagerStyle Mode="NextPrevAndNumeric" />
<MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" DataKeyNames="ID, PK"
HorizontalAlign="NotSet" AutoGenerateColumns="False" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
11 AllowAutomaticUpdates="False" EditMode="Batch">
<BatchEditingSettings EditType="Cell" />
<Columns>
<telerik:GridBoundColumn DataField="Name" HeaderText="Name" SortExpression="Name"
UniqueName="Name" ColumnEditorID="GridTextBoxColumnEditorEditor1">
</telerik:GridBoundColumn>
<telerik:GridHyperLinkColumn DataNavigateUrlFields="Postcode" HeaderText="Location" SortExpression="Location"
DataTextField="Location" UniqueName="Location" DataNavigateUrlFormatString="http://maps.google.co.uk/maps?q={0}">
</telerik:GridHyperLinkColumn>
<telerik:GridNumericColumn DataField="Map" HeaderText="Map" SortExpression="Map"
UniqueName="Map" Display="false" ColumnEditorID="GridTextBoxColumnEditorMap">
</telerik:GridNumericColumn>
<telerik:GridBoundColumn DataField="Sample" HeaderStyle-Width="300px" HeaderText="Equipment" SortExpression="Sample"
UniqueName="Equipment" ColumnEditorID="GridTextBoxColumnEditorEditor3">
</telerik:GridBoundColumn>>
<telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
UniqueName="Delete">
<ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
</telerik:GridButtonColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
protected void rut_Click(object sender, EventArgs e)
{
string v;
foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
{
if (item.FindControl("Map") != null)
{
v = (item.FindControl("Map") as TextBox).Text;
}
}
ClientScript.RegisterStartupScript(this.GetType(), "yourMessage", "alert('" + v + "');", true);
}
I have a radgrid with a column that I'm entering a reference number that I wish to use to extract a corresponding row value. This reference value is not required to be stored so I only need to access the entry whilst the cells are in edit mode (red updated symbol) I wish to use the extracted value to plot a route via google maps.. and the reference will be a number corresponding to the waypoint order. How can I extract a list of strings of postcode column based on numerical value / null value in map column.
<telerik:RadGrid ID="RadGrid1" GridLines="None" runat="server" AllowPaging="True" PageSize="10" EnableViewState="True"
AutoGenerateColumns="False" OnNeedDataSource="RadGrid1_NeedDataSource" OnItemUpdated="RadGrid1_ItemUpdated"
OnItemDeleted="RadGrid1_ItemDeleted" OnItemInserted="RadGrid1_ItemInserted" OnDataBound="RadGrid1_DataBound"
OnItemCommand="RadGrid1_ItemCommand" OnItemDataBound="RadGrid1_ItemDataBound"
CellSpacing="0" Skin="Windows7">
<PagerStyle Mode="NextPrevAndNumeric" />
<MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" DataKeyNames="ID, PK"
HorizontalAlign="NotSet" AutoGenerateColumns="False" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
11 AllowAutomaticUpdates="False" EditMode="Batch">
<BatchEditingSettings EditType="Cell" />
<Columns>
<telerik:GridBoundColumn DataField="Name" HeaderText="Name" SortExpression="Name"
UniqueName="Name" ColumnEditorID="GridTextBoxColumnEditorEditor1">
</telerik:GridBoundColumn>
<telerik:GridHyperLinkColumn DataNavigateUrlFields="Postcode" HeaderText="Location" SortExpression="Location"
DataTextField="Location" UniqueName="Location" DataNavigateUrlFormatString="http://maps.google.co.uk/maps?q={0}">
</telerik:GridHyperLinkColumn>
<telerik:GridNumericColumn DataField="Map" HeaderText="Map" SortExpression="Map"
UniqueName="Map" Display="false" ColumnEditorID="GridTextBoxColumnEditorMap">
</telerik:GridNumericColumn>
<telerik:GridBoundColumn DataField="Sample" HeaderStyle-Width="300px" HeaderText="Equipment" SortExpression="Sample"
UniqueName="Equipment" ColumnEditorID="GridTextBoxColumnEditorEditor3">
</telerik:GridBoundColumn>>
<telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
UniqueName="Delete">
<ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
</telerik:GridButtonColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
protected void rut_Click(object sender, EventArgs e)
{
string v;
foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
{
if (item.FindControl("Map") != null)
{
v = (item.FindControl("Map") as TextBox).Text;
}
}
ClientScript.RegisterStartupScript(this.GetType(), "yourMessage", "alert('" + v + "');", true);
}