| protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) |
| { |
| if (e.CommandName == "RowClick" && e.Item is GridDataItem) |
| { |
| GridEditableItem eeditedItem = e.Item as GridEditableItem; |
| int customerId = Convert.ToInt32(editedItem.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["CustomerId"]); |
| } |
| } |
use the above code block to take CustomerId of selected customer which was written by one of board members. But I have no datakeyvalues because mygridview use needdatasource and advance binding as below
| protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e) |
| { |
| RadGrid1.DataSource = GetDataTable("SELECT Customerid,CustomerName,CustomerSurname FROM Customers "); |
| } |
Hi
I'm using the lastest Q2009 release.
Since I 've updated my project with this release I have a problem with my grid.
I change the rows backcolor in case of a value. (normal, orange or red)
With the latest release the backgroud column with the numeric data stay in white colors.
See a screen here :
http://www.berim.fr/telerik/telerik.htm
Here my code
Protected Sub RadGrid1_ItemDataBound1(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
'Is it a GridDataItem
If (TypeOf (e.Item) Is GridDataItem) Then
'Get the instance of the right type
Dim dataBoundItem As GridDataItem = e.Item
dataBoundItem.ForeColor = Color.Black
'Check the formatting condition
If (CType(dataBoundItem("TaillePST").Text, Double) > 1.6) And (CType(dataBoundItem("TaillePST").Text, Double) < 2) Then
dataBoundItem("TaillePST").Font.Bold = True
dataBoundItem.BackColor = System.Drawing.ColorTranslator.FromHtml("#fed687")
'Customize more...
End If
If (CType(dataBoundItem("TaillePST").Text, Double) > 2) Then
dataBoundItem("TaillePST").Font.Bold = True
dataBoundItem.BackColor = System.Drawing.ColorTranslator.FromHtml("#f8a2a2")
'Customize more...
End If
If (CType(dataBoundItem("TaillePST").Text, Double) = -1) Then
dataBoundItem("NomPST").ForeColor = Color.Red
dataBoundItem("NomPST").Font.Bold = True
'Customize more...
End If
If (CType(dataBoundItem("TaillePST").Text, Double) = -2) Then
dataBoundItem("NomPST").Font.Bold = True
dataBoundItem.BackColor = System.Drawing.ColorTranslator.FromHtml("#c3f3cd")
'Customize more...
End If
End If
End Sub
And the grid declation
<
telerik:RadGrid ID="RadGrid1" runat="server" Style="z-index: 101; left: 8px; position: absolute; top: 200px"
Width="630px" ForeColor="Black" Skin="Default" GroupingEnabled="False">
<
MasterTableView CellSpacing="-1">
</
MasterTableView>
<
FilterMenu Skin="Gray" EnableTheming="True">
<
CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</
FilterMenu>
<StatusBarSettings LoadingText="Chargement..." />
</telerik:RadGrid>
| <radg:radgrid skin="Windows" enableajax="true" onneeddatasource="grdBookingClients_NeedDataSource" |
| gridlines="None" id="grdBookingClients" runat="server" enableajaxloadingtemplate="True" |
| loadingtemplatetransparency="10" showstatusbar="true" autogeneratecolumns="False" |
| ondeletecommand="grdBookingClients_DeleteCommand"> |
| <MasterTableView CommandItemDisplay="Top" DataKeyNames="BookingClientID" Name="BookingClient"> |
| <Columns> |
| <radG:GridBoundColumn HeaderText="Title" UniqueName="Title" DataField="Title"></radG:GridBoundColumn> |
| <radG:GridBoundColumn HeaderText="Forename" UniqueName="Forename" DataField="Forename"></radG:GridBoundColumn> |
| <radG:GridBoundColumn HeaderText="Surname" UniqueName="Surname" DataField="Surname"></radG:GridBoundColumn> |
| <radG:GridButtonColumn ButtonType="ImageButton" ConfirmText="Are you sure you want to delete this record?" CommandName="Delete" ImageUrl="./images/DataEditing/Delete.gif" Text="Delete" UniqueName="DeleteRecord"> |
| </radG:GridButtonColumn> |
| </Columns> |
| <ExpandCollapseColumn Resizable="False"> |
| <HeaderStyle Width="20px" /> |
| </ExpandCollapseColumn> |
| <RowIndicatorColumn Visible="False"> |
| <HeaderStyle Width="20px" /> |
| </RowIndicatorColumn> |
| </MasterTableView> |
| <ExportSettings> |
| <Pdf PageBottomMargin="" PageFooterMargin="" PageHeaderMargin="" PageHeight="11in" |
| PageLeftMargin="" PageRightMargin="" PageTopMargin="" PageWidth="8.5in" /> |
| </ExportSettings> |
| </radg:radgrid> |
| RadGrid1.MasterTableView.Items(0).Selected = True |
But is there anything like this I can use to select the last one?
Hi,
I have a RadTabStrip with 2 tabs connected to a RadMultipage with 2 pages. On 1 page I have anoth tab with 7 tabs and a grid in another mulitpage. On the second page of the first tab I have a couple of list boxes.
When the tab is selected for the listbox pageview the radwindow is fine. When I return to the pageview containing the grid and other tab the scrollbar appears on the side of the window and I can scroll down about another 1/4 of the window wvwn though nothing is there. Everything fits on th page but by viewing the grid the window thinks there is more.
I have set the width and height of the grid to be less than the multipage width and height and everything fits on normally.
I have set the ajaxmanager to: UpdatePanelsRenderMode="Inline".
I have set the grid to: <Scrolling UseStaticHeaders="True" AllowScroll="True"></Scrolling>
I have set the body style to: <body style="overflow:hidden">
I have now run out of tricks....any suggestions?
I feel it could be something to do with the actual height of the grid compared to the shown height of the grid with the window thinking that the grid is taller than it is.
Regards
Roger
| <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="3"> |
| <telerik:RadPageView ID="RadPageView1" runat="server"> |
| <asp:FormView ID="NPProfile" runat="server"> |
| <ItemTemplate> |
| <div id="Desc_Photo"> |
| <asp:Image ID="NPPhoto" runat="Server" CssClass="detailPhoto" /> |
| </div> |
| <div class="Desc_Container"> |