Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
208 views
Hey Guys,

We have a project where we are using a static table (<table>) as the header, below that is the RadGrid with its ShowHeader="false". Depending on the amount of data, the grid automatically sizes its columns (ignoring the ItemStyle and HeaderStyle Width property).

What I need to do is to get the first row, and get each cell's width property in Javascript then assign that width to my static table's "header" cells. I have been searching for weeks on end trying to get an article that describes what I'm trying to do but to no avail.

What I have tried is the following:

$(document).ready(function () {
    var MasterTable = $find("<%= RadGridSec31.ClientID %>").get_masterTableView();
    var Rows = MasterTable.get_dataItems();
    var row = Rows[0];
    var testWidth = row.get_element().cells[4].width;
 
    alert(testWidth); //--> This returns an empty string
});

Obviously this is not correct because the alert shows empty, and there is no javascript errors in the debugging console either. How do I get the width of each cell in the first row of the grid?
Juan
Top achievements
Rank 1
 answered on 14 Nov 2013
2 answers
85 views
I have a Master RadGrid containing databound items. When selecting an item i change content in two child grids (contained in a TabStrip), this works fine. 
Like with the Grids, I would like to change the content on a Rotator (which is also in a tab), when one of the items in the grid is selected. I have tried to Rebind the datasource on my rotator in a item selected event on the grid. This however didn't work. Binding Rotator on Page_Load() works, but this is not what i want. 
Is it possible to do this async? (I want to get images for rotator when an item is selected)
Lars
Top achievements
Rank 1
 answered on 14 Nov 2013
1 answer
304 views
Hi Guys,

Having a heck of a time here. 

We have one client who has a grid (radGrid) in which all rows are always in edit mode, and it uses a edit form user control for its edit mode.

I am trying to add a "Update All" button on the main page (just above the grid). In the button click event I need to loop thru all rows of the grid, find the user control and call a method on the user control that will update its data. I expected I would just call the Update button click event directly.

Problem is, no matter how I try, I cannot "find" the user control. Here is what I have tried:

foreach (GridDataItem dataitem in rgReview.Items)
        {
            if (dataitem.ItemType == GridItemType.AlternatingItem || dataitem.ItemType == GridItemType.Item)
            {   
                GridEditableItem item = (GridEditableItem) dataitem;
                 
                radGridReviewsUserControl userControl = (radGridReviewsUserControl)item.FindControl(GridEditFormItem.EditFormUserControlID);
                 
                string test = "";
 
                radGridReviewsUserControl uc = FindControl<radGridReviewsUserControl>(dataitem.Controls);
 
             }
        }

Notice I tried FindControl as well as a custom recursive FindControl method, and I have iterated thru the objects in debug mode and can find the user control nowhere. Am sure im close.. but just can't find the darn things :(

Can anyone give me a kick in the right direction?

Thanks,

Dave
Princy
Top achievements
Rank 2
 answered on 14 Nov 2013
1 answer
150 views
Princy
Top achievements
Rank 2
 answered on 14 Nov 2013
1 answer
62 views
Hello,

I am developing a table that displays a RadComboBox with a few options. The user is allowed to select multiple items within the RadComboBox, so check boxes are enabled. However, I am having difficulties pulling which items have been checked for each row. I cannot find the dynamically built controls to get the checked items. Also, these RadComboBoxes are not in edit mode. They are simply displaying as normal comboboxes within a grid. How would I access the checked items for each dynamically built combo box? And how could I organize this data by row?

Thanks in advance,

Derek O.
Princy
Top achievements
Rank 2
 answered on 14 Nov 2013
3 answers
251 views
Hi all again,

So it the already a way easy to put the export command buttons on the left??
Or is ther a way to do the same with the template ??


Best regards.
Shinu
Top achievements
Rank 2
 answered on 14 Nov 2013
1 answer
138 views
There is a radbutton in my page and I am writing some C# code in the button click event. In the C# code and I am parsing a date in a try block and if an exception is generated I want to display it and for that I used a radalert. But I found that the alert is displayed after all the c# lines of codes are executed. On debugging that line is executed without any error. Why the delay in displaying the alert, Is this a bug?
Shinu
Top achievements
Rank 2
 answered on 14 Nov 2013
3 answers
153 views
How can I access the value of GridCheckBox column during ItemDataBound Event?

I need access the value and if condition is true hide delete link button.  I have tried many different ways with no luck so far.

Here is my code
Protected Sub PeoplegridCheckrow(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs)
        If TypeOf e.Item Is GridDataItem Then
            Dim dataItem As GridDataItem = CType(e.Item, GridDataItem)
            Dim relationship As String = dataItem("Relationship").Text
            Dim bJournalName As Boolean = (Boolean.Parse(dataItem("UseAsJournalName").Text))
            If relationship = "Family Member" And bJournalName = True Then
                CType(dataItem("DeleteButton").Controls(0), LinkButton).Visible = False
            End If
        End If
    End Sub

Thank you for the help.
Bryan Hughes
Top achievements
Rank 1
 answered on 13 Nov 2013
4 answers
54 views
I am using Radgrid to display the number of attachements under each category. currently the boundcolumn has the datafield = "Name" (Name of the category) alone. If each category row from the master table view is clicked then it will be expanded to show the list of attachments under it, but now i have the requirement to show the count of the attachments also along with the Name of the Category in the Bouncolumn of the MasterTableview. 
BoundColCategory.DataField = "NAME"  + (deatailtable Items Count)
I want the output in the below format
Output Example: Attachment1(s) (20)
                         Attachment2(s) (10)
                         Attachment3(s) 
                        Attachment4(s) (5)
                        Attachment4(s) (11)
                        .........
                        .............
                        .............

I tried to set the datafield/text of the Boundcolumn in events like Item cretead or Pre- render and also in page load but not able to succeed Please help me how to achieve this programmmatically.
Below is the Grid in m
<am:aMGridID="amGrdNotesMaster"runat="server"TabIndex="212"AutoGenerateColumns="false"AllowSorting="false"AllowPaging="false"ClientSettings-AllowColumnsReorder="false"ClientSettings-AllowDragToGroup="false"ShowGroupPanel="false">
      <MasterTableViewDataKeyNames="ID"HierarchyDefaultExpanded="false"NoMasterRecordsText=""NoDetailRecordsText=""GroupLoadMode="Client">
                     <Columns>
                        <telerik:GridBoundColumnHeaderText="Category"DataField= "Name"UniqueName="Category"/>
                         <telerik:GridTemplateColumnUniqueName="Reorder">
                         <ItemTemplate><tm:TMButtonID="btnReorder"runat="server"CommandName="reorder"Text="Reorder based on sort"/></ItemTemplate>
                         </telerik:GridTemplateColumn>
                       </Columns>
                 <DetailTables>
                    <telerik:GridTableViewName="Detail"AllowSorting="true"AllowPaging="false"DataKeyNames="ID"NoMasterRecordsText=""NoDetailRecordsText=""EditMode="InPlace">
                      <Columns>
                         <telerik:GridBoundColumn Uniquename="ID" DataField ="ID" Aggregate ="Count" Visible ="true" ></telerik:GridBoundColumn>
                         <telerik:GridHyperLinkColumnUniqueName="Subject"HeaderText="Subject"DataNavigateUrlFormatString="~/notedisplay.aspx?id={0}"DataNavigateUrlFields="ID"DataTextField="Subject"SortExpression="Subject"ItemStyle-CssClass="gridhyperlink"HeaderStyle-Width="500px"/>
                         <telerik:GridHyperLinkColumnUniqueName="Attachment"HeaderText="Attachment"DataNavigateUrlFormatString="javascript:void(window.open('imageviewer.aspx?a=3&b=Attachment&c={0}', '_blank', 'left=0, top=0, width=785, height=585, titlebar=yes, location=no, status=no, toolbar=no, menubar=no, scrollbars=no, resizable=yes'));"DataNavigateUrlFields="ID"DataTextField="AttachmentName"SortExpression="AttachmentName"ItemStyle-CssClass="gridhyperlink"/>
                         <telerik:GridBoundColumnUniqueName="AddDate"HeaderText="Created"DataField="AddDate"SortExpression="AddDate"ReadOnly="true"/>
                         <telerik:GridBoundColumnUniqueName="ModDate"HeaderText="Last Modified"DataField="ModDate"SortExpression="ModDate"ReadOnly="true"/>
                         <telerik:GridBoundColumnUniqueName="ModUser"HeaderText="Modified By"DataField="ModUser"SortExpression="ModUser"ReadOnly="true"/>
                        <telerik:GridNumericColumn  HeaderText="Position"DataField="SortOrder"SortExpression="SortOrder"UniqueName="SortOrder"/>
                        <telerik:GridEditCommandColumnUniqueName="EditColumn">
                        <ItemStyleCssClass="gridhyperlink"/>
                         </telerik:GridEditCommandColumn>
                       </Columns>
                     </telerik:GridTableView>
                  </DetailTables>
        </MasterTableView>
    <ClientSettingsAllowExpandCollapse="true">
   </ClientSettings>
  </am:aMGrid>
thanks
jose
Joselina
Top achievements
Rank 1
 answered on 13 Nov 2013
21 answers
954 views

I have a RadEditor in a user control, which is being used on a page. What I need to do is verify if the content area on the editor is not blank on button click on client side (and display alert message) And then I need to set focus in the content area on the editor.

I'm able to do everything except set the focus.

When I try to set focus, I get a message saying "Cant move focus to the control because it is invisible, not enabled, or of a type that does not accept focus"

I figured out this is becase the style:display is set to "none". I updated that to "block" and the error message went away, but I still dont see the focus being set.

Please advice.

 

Thanks 

Ianko
Telerik team
 answered on 13 Nov 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?