| If e.CommandName = "UpdateRating" Then |
| Dim item As GridEditableItem = TryCast(e.Item, GridEditableItem) |
| Dim values As New Hashtable() |
| item.ExtractValues(values) |
| values("ChangeRequestID") = item.GetDataKeyValue("ChangeRequestID") |
| values("Completed") = Int16.Parse(values("Completed")) |
| values("Accepted") = Int16.Parse(values("Accepted")) |
| values("Reviewed") = Int16.Parse(values("Reviewed")) |
| For Each entry As DictionaryEntry In values |
| SqlDataSource1.UpdateParameters(entry.Key.ToString()).DefaultValue = entry.Value.ToString() |
| Next |
| SqlDataSource1.Update() |
| End If |
| <telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" ShowStatusBar="True" |
| AllowAutomaticInserts="True" AllowAutomaticUpdates="True" OnItemCommand="RadGrid1_ItemCommand" Height="900px" PageSize="25" Skin="Black" DataSourceID="SqlDataSource1"> |
| <PagerStyle Mode="Slider" /> |
| <MasterTableView CommandItemDisplay="Top" DataKeyNames="ChangeRequestID" AllowMultiColumnSorting="True" DataSourceID="SqlDataSource1" AllowFilteringByColumn="True"> |
| <Columns> |
| <telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="Images/Update.gif" CommandName="UpdateRating" UniqueName="UpdateColumn" HeaderText="Update" /> |
| <telerik:GridEditCommandColumn ButtonType="ImageButton" EditImageUrl="Images/Edit.gif" HeaderText="Edit" /> |
| <telerik:GridRatingColumn DataField="Accepted" UniqueName="Accepted" Precision="Item" ReadOnly="False" ItemCount="1" HeaderText="Accepted" AllowRatingInViewMode="true" /> |
| <telerik:GridRatingColumn Datafield="Reviewed" UniqueName="Reviewed" Precision="Item" ReadOnly="False" ItemCount="1" HeaderText="Reviewed" AllowRatingInViewMode="true" /> |
| <telerik:GridRatingColumn Datafield="Completed" UniqueName="Completed" Precision="Item" ReadOnly="False" ItemCount="1" HeaderText="Completed" AllowRatingInViewMode="true" /> |
| <telerik:GridRatingColumn Datafield="Priority" UniqueName="Priority" Precision="Item" ReadOnly="false" ItemCount="5" HeaderText="Priority" AllowRatingInViewMode="false" /> |
| <telerik:GridBoundColumn DataField="ChangeRequestID" UniqueName="ChangeRequestID" HeaderText="ID" Visible="false" /> |
| </Columns> |
| <EditFormSettings EditFormType="Template"> |
| <EditColumn UniqueName="EditCommandColumn1" /> |
| <FormTemplate> |
| .... |
| <asp:SqlDataSource ID="SqlDataSource1" DataSourceMode="DataSet" runat="server" ConnectionString="<%$ ConnectionStrings:hldbConnectionString %>" |
| InsertCommand="INSERT INTO ChangeRequestTracker(Accepted, Completed, Reviewed, Priority) VALUES (0, 0, 0, @Priority)" |
| SelectCommand="SELECT * FROM ChangeRequestTracker ORDER BY ChangeRequestID DESC" |
| UpdateCommand="UPDATE ChangeRequestTracker SET Priority=@Priority, Accepted=@Accepted, Reviewed=@Reviewed, Completed=@Completed WHERE ChangeRequestID = @ChangeRequestID"> |
| <UpdateParameters> |
| <asp:Parameter Name="ChangeRequestID"/> |
| <asp:Parameter Name="Priority"/> |
| <asp:Parameter Name="Accepted"/> |
| <asp:Parameter Name="Reviewed"/> |
| <asp:Parameter Name="Completed"/> |
| </UpdateParameters> |
| <InsertParameters> |
| <asp:Parameter Name="Priority"/> |
| <asp:Parameter Name="Accepted"/> |
| <asp:Parameter Name="Reviewed"/> |
| <asp:Parameter Name="Completed"/> |
| </InsertParameters> |
| </asp:SqlDataSource> |
| <telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource"> |
| </telerik:RadGrid> |
| Protected Sub RadGrid1_NeedDataSource(ByVal [source] As Object, _ |
| ByVal e As GridNeedDataSourceEventArgs) _ |
| Handles RadGrid1.NeedDataSource |
| Dim list As New ArrayList |
| list.Add("string1") |
| list.Add("string2") |
| list.Add("string3") |
| RadGrid1.DataSource = list |
| End Sub |
| Public Class AContact |
| Private _name As String |
| Private _email As String |
| Public Property Name() As String |
| Get |
| Return _name |
| End Get |
| Set(ByVal value As String) |
| _name = Name |
| End Set |
| End Property |
| Public Property Email() As String |
| Get |
| Return _email |
| End Get |
| Set(ByVal value As String) |
| _email = Email |
| End Set |
| End Property |
| End Class |
| Protected Sub RadGrid1_NeedDataSource(ByVal [source] As Object, _ |
| ByVal e As GridNeedDataSourceEventArgs) _ |
| Handles RadGrid1.NeedDataSource |
| Dim maListe As New List(Of SABerni.Gateway.AContact) |
| Dim Contact1 As New SABerni.Gateway.AContact |
| Contact1.Name = "demo" |
| Contact1.Email = "emaildemo" |
| maListe.Add(Contact1) |
| RadGrid1.DataSource = maListe |
| End Sub |
Hi,
I need to implement several level nested hierarchy with possibility to check (or select) multiple rows, but also whole groups or sub-groups of rows (let say that for rows of orders for customers from different countries I need to group every orders of each customer together and every customers from each country together and then be able to select multiple orders – one by one or every for selected customers or every for selected country – so that after selecting one subgroup, each row of this sub-group will be selected).
I would like to use grouping for this – but I was not able to simply add check-boxes in header lines.
<telerik:GridGroupByExpression>
<SelectFields>
<telerik:GridGroupByField FieldName="countryName" HeaderText=" <input type='checkbox' onClick='CountryRowSelecting()'> " />
</SelectFields>
<GroupByFields>
<telerik:GridGroupByField FieldName="countryId" SortOrder="Descending" HeaderText="Country" />
</GroupByFields>
</telerik:GridGroupByExpression>
<telerik:GridGroupByExpression>
<SelectFields>
<telerik:GridGroupByField FieldName="customerName" HeaderText=" <input type='checkbox' onClick='CustomerRowSelecting()'> " />
</SelectFields>
<GroupByFields>
<telerik:GridGroupByField FieldName="customerId" SortOrder="Descending" HeaderText="Customer" />
</GroupByFields>
</telerik:GridGroupByExpression>
But then I was not able to properly handle these events, I think there should be some easier way.
I was also trying hierarchical grid (but I would like it with grouping more), but there with multi-rows grouping, when I selected whole category, just one sub-level subcategories was selected (but I need it for each level- e.g. after selecting some country, each order for each customer from this country would be selected).
Does radgrid somehow enable this desired behaving?
Thanks
Jan
I have a rotator within a user control. The content size of the screen is being set via JavaScript with scroll bars turned on. The browser scroll bars are turned off so not to confuse the user with two sets. The images within the rotator work just fine except for one major issue. The image “hovers” over the page and does not position itself within the rotator. Only when the browser scroll bars are active and the content scroll bars are turned off does the image behave correctly. Attached is the code and any assistance would be greatly appreciated.
| <telerik:RadRotator ID="thumbRotator" runat="server" RotatorType="ButtonsOver" Height="120px" Width="600px" ItemHeight="120px" ItemWidth="150px" FrameDuration="1" ScrollDuration="500" ScrollDirection="Left,Right" EnableEmbeddedSkins="false" OnItemClick="ShowImage"> |
| <ItemTemplate> |
| <div style="text-align:center; padding:20px;"> |
| <asp:Image ID="imgRotator" runat="server" Height="50px" Width="50px" ImageUrl='<%# DataBinder.Eval(Container.DataItem,"Source") %>' /> |
| <br /> |
| <%# DataBinder.Eval(Container.DataItem, "TypeDescription")%> |
| <br /> |
| (<%# DataBinder.Eval(Container.DataItem, "Size")%>) |
| </div> |
| </ItemTemplate> |
| <ControlButtons LeftButtonID="img_left" RightButtonID="img_right" /> |
| </telerik:RadRotator> |
| <asp:HyperLink |
| ID="HyperLink1" |
| runat="server" |
| NavigateUrl = "\\server\share\SomeDoc.doc> |
| </asp:HyperLink> |
| "John", "\\server\share\John.doc" |
| "Mary", "\\server\share\Mary.doc" |
| etc... |