<
telerik:RadGrid ID="RadGrid1" runat="server" Width="150"
PageSize="20" AllowSorting="True" AllowMultiRowSelection="False" Skin="Default"
AllowPaging="True" ShowGroupPanel="True" AutoGenerateColumns="false" GridLines="none" OnItemCommand="RadGrid1_ItemCommand">
</telerik:RadGrid>
then in the default.aspx.vb i have a pageload to load the data and column.
RadGrid1.DataSource = "sqlsource1"
Dim boundcolumn As GridBoundColumn
boundcolumn =
New GridBoundColumn
boundcolumn.DataField =
"Department"
boundcolumn.HeaderText =
"Department"
RadGrid1.MasterTableView.Columns.Add(boundcolumn)
RadGrid1.DataBind()
now i want to be able to detect a click on the row click and then open something with the column value like the Auto postback on row click example that you guys have on the web. i could detect the click but it keeps giving me error of "Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index"
here is my onclick itemcommand code
Protected
Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
Thread.Sleep(2000)
If (e.CommandName = "RowClick" AndAlso TypeOf e.Item Is GridDataItem) Then
e.Item.Selected =
True
Dim text As String = "Selected mail ID is: " & e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("MailID")
RadGrid1.Controls.Add(
New LiteralControl(String.Format("<span style='color:red'>{0}</span>", text)))
End If
End Sub
what did i do wrong here? could you help me. thank you very much
| RadPanelItem it = new RadPanelItem("Root1"); |
| HtmlGenericControl control = new HtmlGenericControl("div"); |
| control.InnerHtml = "<table style='width:660px'><tr>"+thread.subject+"<td></td>"+GetDateDiference(thread.lastpostDate)+"<td></td></tr><tr><td>Posted by: "+thread.CMSMember.username+"</td><td>Replies:"+thread.CMSForumMessages.Count+"</td></tr><tr><td colspan='2'>"+GetThreadReplyLinkCommand()+"</td></tr></table>"; |
| it.Controls.Add(it); |
| threadsBar.Items.Add(it); |
Hi All
I Create Rad Window by Vb.net language on behind code at Page1
this code in the button1 for create rad window
Dim RW As New RadWindow
RW.ID = "Rad2"
RW.ShowContentDuringLoad = True
RW.Width = 600
RW.Height = 500
RW.NavigateUrl = ("TestPage2.aspx")
RW.VisibleTitlebar = False
RW.VisibleStatusbar = False
RW.Modal = True
Me.RadWindowManager1.Windows.Clear()
Me.RadWindowManager1.Windows.Add(RW)
Me.RadWindowManager1.Windows(0).VisibleOnPageLoad = True
and then On Rad Window will open Page2. On Page2 has button2
i would like to button2 do close rad window pop up and redirect Page1 to New Page.
how can i coding it by vb.net language only or rad window is not support...
Thank a lot
I tried setting the CurrentViewBeginDate and CurrentViewEndDate properties. But it didn't work and i always see the RadCalendar reset to current calendar month.
RadCalendar1.CalendarView.CurrentViewBeginDate = (
DateTime)ViewState["RadCStartDate"];
if(ViewState["RadCEndDate"] != null)
RadCalendar1.CalendarView.CurrentViewEndDate = (
DateTime)ViewState["RadCEndDate"];
Any feedback will be appreciated.
Thanks
Padma
<
telerik:GridTemplateColumn UniqueName="CompanyName" HeaderText="Company Name" DataField="CompanyName">
<ItemTemplate>
<asp:Label ID="lblVendorID" runat="server" Text='<%# Eval("CompanyName")%>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox ID="ddlCompanyName" runat="server" DataTextField="CompanyName" DataValueField="CompanyName" MarkFirstMatch="true" SelectedValue='<%# Bind("CompanyName") %>' DataSourceID="SDSVendorCompany" AppendDataBoundItems="true" AllowCustomText="true">
<Items><telerik:RadComboBoxItem Text="- Select One -" Value="" /></Items>
</telerik:RadComboBox>
</EditItemTemplate>
<ItemStyle HorizontalAlign="Left" VerticalAlign="Top" /> </telerik:GridTemplateColumn>
I"m testing it here, and if I type in a new value, the value of test is always 'Nothing'. If I choose an existing value, it works great.
Protected Sub SDSVendors_Inserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceCommandEventArgs) Handles SDSVendors.Inserting
Dim test As String = e.Command.Parameters("@CompanyName").Value
E
nd Sub
Hello,
I have a telerik radgrid with two item templates. Categories are appeared at the left item template and related categories at the right. I would like every time i choose one item at the left side , only one item (one row) to be appeared and not all. Thank you very much.
This is the aspx code:
<
telerik:RadGrid ID="cr" runat="server" AutoGenerateColumns="false" Skin="Vista" EnableViewState="false">
<MasterTableView>
<Columns>
<telerik:GridTemplateColumn HeaderText="">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("sDescr") %>' NavigateUrl='<%# String.Format("CategoryRelations2.aspx?fromCategoryID={0}", Eval("lRow_Id")) %>'></asp:HyperLink>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="">
<ItemTemplate>
<asp:Repeater ID="RelatedCategories" runat="server" DataSource="<%# GetRelatedCategories(Container.DataItem as Category) %>">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("sDescr") %>' NavigateUrl='<%# String.Format("CategoryRelations2.aspx?fromCategoryID={0}&toCategoryID={1}", DataBinder.Eval(Container, "Parent.Parent.Parent.DataItem.lRow_Id"), Eval("lRow_Id")) %>'></asp:HyperLink>
</ItemTemplate>
<SeparatorTemplate>
,
</SeparatorTemplate>
</asp:Repeater>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>