Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
76 views
Hello,

When I am using check box in a server-side grid to select all rows, It selects only the rows in the first page. Why it is not selecting the other pages in the Rad Grid?

Thank You
Asok
Pavlina
Telerik team
 answered on 26 Oct 2009
2 answers
87 views
Hello,

Since start of RadControls for Ajax.net, this has not been improved, I don't know why.
It seems we still have to work in codebehind to say I don't want the Add New button, but want the command Item without using a template necessitating a large rework (not skin support in CommandItemTemplate, etc) , isn't it ?

More on command item: the various ShowExportToxxxButton are not recognised by intellisence(certainly a missing declaration) but this is not a show stopper.
What I woul expect would be to be able to write code like this:

<CommandItemSettings  RefreshText="<%$ Resources:ADNCRM,ORDER_VIEW_REFRESH %>"   
                            ShowExportToExcelButton='<%# (ShouldExport2XL) %>' /> 
                             
but Visual Studio states that this kind of binding is not ok for radGrid ?

Last point, we should not have to add again 2 lines of javascript to fix that these Export buttons should not generate a callback but a real postback. Telerik has everything to do this in background.

My pages are full of these 2 or 3 javascript patch, very uneasy to maintain!
Eliminating all these small 'logical' patches would be a target for Telerik.

Product is good but has to be improved for existing features also.

Regards

CS
CSurieux
Top achievements
Rank 2
 answered on 26 Oct 2009
2 answers
509 views
Hello,

I need to get the cell value of a grid column that I have set to false. When I make it visible true, I am getting the values. I am using the client side script to get the value when clicking the check box in the grid.

The below is the javascript function I use to ge the value

 

 

 

function getGridCheckedValues(){   
   var grid = $find("<%=RadGrid1.ClientID %>");   
   var MasterTable = grid.get_masterTableView();   
   var selectedRows = MasterTable.get_selectedItems();   
  for (var i = 0; i < selectedRows.length; i++){  
  var row = selectedRows[i];   
  var cell = MasterTable.getCellByColumnUniqueName(row, "fld_id");  
  alert(cell.innerHTML);   
 
  }  
 
   
 
}  
 
 
 

This is the code I use in the HTML. Please note the column "fld_id".

 

 

 

 

<telerik:RadGrid AllowSorting="True" ID="RadGrid1" AllowPaging="True" runat="server" Skin="Vista" 
 
 
 
GridLines="None" OnItemDataBound="RadGrid1_ItemDataBound" AutoGenerateColumns="False" 
 
 
 
ShowDesignTimeSmartTagMessage="False" Width="800" OnSortCommand="RadGrid1_SortCommand" AllowMultiRowSelection="true" 
 
 
 
OnNeedDataSource="RadGrid1_NeedDataSource" OnPageIndexChanged="RadGrid1_PageIndexChanged">  
 
 
 
<MasterTableView TableLayout="Auto" DataKeyNames="fld_id">   
 
<Columns>   
 
<telerik:GridBoundColumn DataField="fld_id" HeaderText="Id" SortExpression="fld_id" 
 
 
 
UniqueName="fld_id" ReadOnly="true" Visible="false">  
 
 
 
<HeaderStyle Width="0px" /> 
 
 
 
</telerik:GridBoundColumn> 
 
 
 
<telerik:GridClientSelectColumn UniqueName="fld_id" /> 
 
 
 
<telerik:GridBoundColumn DataField="fld_firstname" ReadOnly="True" HeaderText="<%$Resources:WSPL, FirstName %>" 
 
 
 
SortExpression="fld_firstname" UniqueName="fld_firstname">  
 
 
 
<HeaderStyle Width="150px" /> 
 
 
 
<ItemStyle Width="150px" /> 
 
 
 
</telerik:GridBoundColumn>   
 
<telerik:GridBoundColumn DataField="fld_lastname"   
 
ReadOnly="True" HeaderText="<%$Resources:WSPL, LastName %>" UniqueName="fld_lastname">  
 
 
 
<HeaderStyle Width="150px" /> 
 
 
 
<ItemStyle Width="150px" /> 
 
 
 
</telerik:GridBoundColumn> 
 
 
 
<telerik:GridBoundColumn DataField="fld_email"   
 
ReadOnly="True" HeaderText="<%$Resources:WSPL, Email %>" UniqueName="fld_email">  
 
 
 
<HeaderStyle Width="150px" /> 
 
 
 
<ItemStyle Width="150px" /> 
 
 
 
</telerik:GridBoundColumn> 
 
 
 
<telerik:GridBoundColumn DataField="fld_country" ReadOnly="True" HeaderText="<%$Resources:WSPL, Country %>" 
 
 
 
SortExpression="fld_country" UniqueName="fld_country">  
 
 
 
<HeaderStyle Width="120px" /> 
 
 
 
<ItemStyle Width="120px" /> 
 
 
 
</telerik:GridBoundColumn>   
 
<telerik:GridBoundColumn DataField="fld_wingspan" ReadOnly="True" HeaderText="<%$Resources:WSPL, WingSpan %>" 
 
 
 
SortExpression="fld_wingspan" UniqueName="fld_wingspan">  
 
 
 
<HeaderStyle Width="120px" /> 
 
 
 
<ItemStyle Width="120px" /> 
 
 
 
</telerik:GridBoundColumn>   
 
<telerik:GridTemplateColumn Resizable="False" UniqueName="TemplateColumn2">  
 
 
 
<HeaderStyle Width="30px" /> 
 
 
 
<ItemStyle Width="30px" /> 
 
 
 
<ItemTemplate> 
 
 
 
<asp:ImageButton ToolTip="<%$Resources:WSPL, ClickToView %>" ImageUrl="~/img/zoom.gif" 
 
 
 
CommandName="viewCoach" runat="server" ID="img_View" /> 
 
 
 
</ItemTemplate> 
 
 
 
</telerik:GridTemplateColumn>   
 
</Columns>   
 
</MasterTableView>   
 
<ClientSettings EnableRowHoverStyle="true">  
 
 
 
<ClientEvents OnRowDblClick="RowDblClick" OnGridCreated="GridCreated" /> 
 
 
 
<Selecting AllowRowSelect="True" />   
 
</ClientSettings>   
 
<PagerStyle Mode="NumericPages" />   
 
</telerik:RadGrid> 
 
 
 
 
 

Thanks in advance.

 

 

 

Asok
Top achievements
Rank 1
 answered on 26 Oct 2009
3 answers
96 views
I am using the grid to dispaly different photo albums. When the ComboBox album selector changes and with ViewState of the Grid enabled, the handler for the OnSelectedIndexChanged event for the ComboBox calls the Rebind() method of the grid to force the grid to rebind which eventually results in the OnNeedDataSource being called to allow the data source for the grid to be updated.

It appears that the Grid.CurrentPageIndex is not being reset to zero when the Grid is rebound. So if this index was anything other than 0 when the Rebind() method was called, an attempt to load the grid with the page index of the previous state of the grid will result.

Since ViewState is enabled, an argument could be made that the CurrentPageIndex is just being persisted due to the persistence resulting from ViewState. But is there really ever a valid case where the paging index should be anything other than 0 after the Grid is rebound.

To me new data implies a new state with indexes reset to zero. If for some reason someone wants an index other than zero when the grid rebinds, then it would seem to be up to them to set the index to whatever they wanted.

I have a feeling that this is not going to go my way.  No big deal, this is a very, very good product.
Sebastian
Telerik team
 answered on 26 Oct 2009
1 answer
118 views
I have a javascript for opening new window

function

 

NewWindow(mypage, myname, w, h, scroll) {

 

 

var winl = (screen.width - w) / 2;

 

 

var wint = (screen.height - h) / 2;

 

winprops =

'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'

 

win = window.open(mypage, myname, winprops);

win.focus();

}


in My code i am opening this in gridview item command(Not radgrid). I am using radjax manager .The window is not opening.
Code:

Dim

 

strScript As String

 

strScript =

"<script language=JavaScript"

 

strScript = strScript &

" >"

 

strScript = strScript &

"NewWindow('proposed_material_list_modify.aspx?prop_id=" & Request.QueryString("prop_id") & "&mtrl_id=" & sMtrlId & "&Root=" & Request.QueryString("Root") & "&GroupID=" & Request.QueryString("GroupID") & "&PIN=" & MaterialGrid.CurrentPageIndex & "&IMGS=" & CheckBox1.Checked & "','Add_Note','650','600','no'); "

 

strScript = strScript &

" <"

 

strScript = strScript &

"/" & "script> "

 

ClientScript.RegisterStartupScript(

Me.GetType, "Reject Note", strScript)

 

Daniel
Telerik team
 answered on 26 Oct 2009
1 answer
88 views
We are using Rad Upload Control to send the mail with attachment through SMTP server. The Code working fine if the we run in the local machine. If we deploy the code in the server and access the link from remote machine, the attachment path is set as "C:\Windows\system32\<filename>"  even u select the file from any location. Please let us know how to resolve this
Veselin Vasilev
Telerik team
 answered on 26 Oct 2009
1 answer
155 views
Greetings!

We were getting a blank page (nothing except headers and footers) when printing the contents of a RadWindow (for ASP.Net Ajax) using a Custom Button (according to the KB article: "Adding a Custom Button to RadWindow Titlebar") in IE 8.  Adding the following meta tag to the page referenced by the RadWindow solved the problem:

 

<meta http-equiv="X-UA-Compatible" content="IE=7" /> 

 

 

 

Insert the tag after the DOCTYPE declaration and just before the HTML Head section.

The tag forces IE 8 to render the page in IE 7 compatibility mode.  We didn't experience this phenomenon when using other browsers.  Not sure exactly what caused IE 8 to print a blank first page.  So, please post a reply if you've experienced this and found an alternative solution.

Hope this saves you time!

Mark Masson
Director of Technology
Lucid Data Corporation
Georgi Tunev
Telerik team
 answered on 26 Oct 2009
1 answer
159 views
hi

I have a grid that display images using image button: I want to be able to retrieve the ID and a response.redirect when click. This is my code:
<ItemTemplate> 
                <asp:ImageButton ID="ImageButton1" runat="server"   
                    ImageUrl="~/image/first.png" /> 
                <br />&nbsp;&nbsp;&nbsp;  
                <asp:Label ID="BranchLabel" Width="150px" runat="server"   
                    Text='<%# Eval("Branch") %>' /> 
                <br /> 
                <br /> 
            </ItemTemplate> 

My Code Behind:

 

 

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load  
Dim imagebutton As ImageButton = TryCast(Page.Master.FindControl("RadGrid1"), ImageButton)  
End Sub  
 

Thanks

 

Daniel
Telerik team
 answered on 26 Oct 2009
1 answer
201 views
Hi Support.

Before you directly jump to find the solution, please understand the issue first and also know that I've already spent some time trying to fix it myself.

Here is the problem.

I've a simple RadGrid placed on the form that loads around 3000 rows, with no virtual scroll, no grouping, no hi-fi setting.. Simple RadGrid.
Now, as soon as I place a CheckBox column, or a ClientSelectColumn or a TemplateColumn with a CheckBox, I see unnecessary Vertical ScrollBar showing up on my PAGE NOT the RADGRID.

Below is the html to to generate the radgrid. Note that the RadGrid is placed inside the RadAjaxPanel with Rad

<

 

telerik:RadGrid ID="RadGrid1" runat="server" SkinID="ShowAllRecords_AutoGeneratedFalse"

 

 

 

AllowFilteringByColumn="True" AllowSorting="True" GridLines="None"

 

 

 

onneeddatasource="rgvwMaterialHierarchy_NeedDataSource">

 

 

 

<MasterTableView TableLayout="Fixed" CommandItemDisplay="Top" >

 

 

 

<Columns>

 

 

 

<telerik:GridCheckBoxColumn /> ------>This line here... if I remove this line everything is PERFECT. But I need a checkbox column.

 

 

 

<telerik:GridTemplateColumn DataField="MaterialHierarchyCode" SortExpression="MaterialHierarchyCode" HeaderStyle-HorizontalAlign ="center" HeaderStyle-VerticalAlign ="middle" HeaderText ="Hierarchy Code" UniqueName ="MaterialHierarchyCode" HeaderStyle-Width="15%" ItemStyle-Width="15%" FilterControlWidth="80%" AutoPostBackOnFilter="true">

 

 

 

<ItemTemplate >

 

 

 

<asp:Label ID="lblMaterialHierarchyCode" runat="server" Text='<%# Bind("MaterialHierarchyCode")%>' ToolTip='<%# Bind("MaterialHierarchyCode")%>'></asp:Label>

 

 

 

</ItemTemplate>

 

 

 

<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

<telerik:GridTemplateColumn DataField="MaterialHierarchyDescription" SortExpression="MaterialHierarchyDescription" HeaderStyle-HorizontalAlign ="center" HeaderStyle-VerticalAlign ="middle" HeaderText ="Hierarchy Name" UniqueName ="MaterialHierarchyDescription" HeaderStyle-Width="54%" ItemStyle-Width="54%" FilterControlWidth="80%" AutoPostBackOnFilter="true">

 

 

 

<ItemTemplate >

 

 

 

<asp:Label ID="lblMaterialHierarchyDescription" runat="server" Text='<%# Bind("MaterialHierarchyDescription")%>' ToolTip='<%# Bind("MaterialHierarchyDescription")%>'></asp:Label>

 

 

 

</ItemTemplate>

 

 

 

<EditItemTemplate>

 

 

 

<telerik:RadTextBox ID="txtMaterialHierarchyDescription" runat="server" Text='<%# Bind("MaterialHierarchyDescription")%>' MaxLength="1000" Width="90%" AutoCompleteType="Disabled"></telerik:RadTextBox>

 

 

 

<asp:RequiredFieldValidator ID="rvftxtMaterialHierarchyDescription" runat="server" ControlToValidate="txtMaterialHierarchyDescription" ErrorMessage="Hierarchy Name cannot be blank" Display="Dynamic"></asp:RequiredFieldValidator>

 

 

 

</EditItemTemplate>

 

 

 

<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

<telerik:GridTemplateColumn UniqueName="Detail" HeaderText="Details" AllowFiltering="false" HeaderStyle-HorizontalAlign ="center" HeaderStyle-VerticalAlign ="middle" HeaderStyle-Width="10%" ItemStyle-Width="10%" >

 

 

 

<ItemTemplate>

 

 

 

</ItemTemplate>

 

 

 

<HeaderStyle></HeaderStyle>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

<telerik:GridTemplateColumn UniqueName="Properties" HeaderText="Properties" AllowFiltering="false" HeaderStyle-HorizontalAlign ="center" HeaderStyle-VerticalAlign ="middle" HeaderStyle-Width="12%" ItemStyle-Width="12%" >

 

 

 

<ItemTemplate>

 

 

 

</ItemTemplate>

 

 

 

<HeaderStyle Width="80px"></HeaderStyle>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

<telerik:GridEditCommandColumn UniqueName="Edit" HeaderText="Edit" ButtonType="ImageButton"

 

 

 

CancelText="Cancel" UpdateText="Update" InsertText="Add New Hierarchy" HeaderStyle-Width="6%" ItemStyle-Width="6%" CancelImageUrl="~/Images/cancel.png" UpdateImageUrl="~/Images/Save.png"

 

 

 

InsertImageUrl="~/Images/Save.png" EditImageUrl="../Images/pencil.png">

 

 

 

</telerik:GridEditCommandColumn>

 

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

<ClientSettings>

 

 

 

<Scrolling AllowScroll="True" ScrollHeight="600" UseStaticHeaders="True" />

 

 

 

</ClientSettings>

 

 

 

</telerik:RadGrid>

 

 

Pavlina
Telerik team
 answered on 26 Oct 2009
2 answers
122 views
Hello,


Why using expressions like

<CommandItemSettings

 

RefreshText="<%$ Resources:ADNCRM,ORDER_VIEW_REFRESH %>"

 

 

ShowExportToExcelButton='<%# (ShouldExport2XL) %>' />

is not possible in VS2008 for Radgrid (Error message in design mode)
I know we could do it in code behind but the price is writing lot of code.


Thanks
CS

CSurieux
Top achievements
Rank 2
 answered on 26 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?