Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
66 views
Hi All

I have a function that resizes a grid page size when the page has loaded,
I have used the "OnClientLoad" event of the main page splitter to fire this function.

However when the function uses an ajax request i get the following error:
Line 24610
Error this_tooltips.length is null or not an object
(I have attached a screen Shot)

This is the code:
Java:
function gridPsize() {
                    var h1 = $find("<%= RadSplitter5.ClientID %>").get_height();
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Grid1PageSize" + h1);
               }
Vb Code
Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
      If Left(e.Argument, 13) = "Grid1PageSize" Then
            'Set Radgrid1 page size
            Dim pHeight As Integer = CInt(Right(e.Argument, Len(e.Argument) - 13))
            Dim rows As Double = (pHeight - 110) / 30
  
            If rows >= 1 Then
                RadGrid1.PageSize = CInt(rows)
                RadGrid1.Rebind()
            End If
  
            End If
  
    End Sub
The Problem does not occur on initial load of the page, It seems to occur on a re-query of the Grid? But not all the time.
I was wondering if it was related to mouse position on the grid as i have tooltips coded to the grid's ItemDataBound Event, The tooltips were in the ItemCreated Event but i moved them to see if it would cure the problem.

If anyone could shed any light on this it would be most appriciated.

Many Thanks

Regards

Darren
Maria Ilieva
Telerik team
 answered on 10 Jan 2011
1 answer
155 views
Hello,

I use the following code to enable multiple selection in the radtreeview. The code only works in IE and not in Chrome or FireFox. 
Could someone help me with this issue?

Code:

<telerik:RadCodeBlock ID="cb1" runat="server">


        <script language="javascript" type="text/javascript">
                   
        var RadTreeIsMultiSelecting = false;
        
        function CommitTree(e)
        {
            if (!e.ctlrKey | !e.shiftKey) 
            {
                if (RadTreeIsMultiSelecting)
                {
                    var aMan = $find("<%= ajMan.ClientID %>");
                    aMan.ajaxRequest("RadTree");
                    
                }
            }
        }


        function RadTreeClicked(sender, args)
        {
            RadTreeIsMultiSelecting = args._domEvent.ctrlKey | args._domEvent.shiftKey;
            var tree = $find("<%= RadTree.ClientID %>"); 
            tree.commitChanges();
        }
            
            
        </script>


    </telerik:RadCodeBlock>

Nikolay Tsenkov
Telerik team
 answered on 10 Jan 2011
1 answer
77 views
<telerik:GridTemplateColumn DataField="DelFlag" HeaderText="Status" SortExpression="DelFlag"
                            HeaderStyle-HorizontalAlign="Center" UniqueName="DelFlag" Visible="true" AllowFiltering="false">
                            <ItemTemplate>
                                <asp:Button ID="btnStatus" Font-Size="11px" Width="65px" runat="server" Text='<%#Eval("DelFlag")%>'
                                    OnClientClick="javascript:return confirm('Are you sure want to update status !!?')"
                                    CommandName="Command" />
                            </ItemTemplate>
                            <ItemStyle VerticalAlign="Middle" HorizontalAlign="Center" />
                        </telerik:GridTemplateColumn>


and following code on serverside .cs fle
 else if (e.CommandName == "Command")
            {
                GridDataItem item = (GridDataItem)e.Item;
                Button btnStatus = (Button)e.CommandSource;
                if (btnStatus.Text == "Deactivate")
                {
                    btnStatus.Text = "Activate";
                    string gameGID = Convert.ToString(((Label)item.FindControl("lblGameGID")).Text);
                    string delflag = "Y";
                    ds.UpdateCommand = "UPDATE tblGame SET DelFlag = '" + delflag + "' WHERE GameGID = '" + gameGID + "'";
                    ds.Update();
                    grdGameInfo.DataSource = ds;
                    grdGameInfo.DataBind();
                    grdGameInfo.Rebind();
                }
                else
                {
                    
                    btnStatus.Text = "Deactivate";
                    string gameGID = Convert.ToString(((Label)item.FindControl("lblGameGID")).Text);
                    string delflag = "N";
                    ds.UpdateCommand = "UPDATE tblGame SET DelFlag = '" + delflag + "' WHERE GameGID = '" + gameGID + "'";
                    ds.Update();
                    grdGameInfo.DataSource = ds;
                    grdGameInfo.DataBind();
                    grdGameInfo.Rebind();
                }


this will work if rad AJAX managar not on page.. If i put rad ajax .. the above scrip not working. It's only show alert message.. but server side event does not call. Please help how to call need urgent.
Princy
Top achievements
Rank 2
 answered on 10 Jan 2011
1 answer
90 views
I'm trying to get my RadGrid to allow updating to Oracle using a custom WebControl. I have went though numerous examples and always have one or two small things that dont seem to work correctly. There seems to be some many variations of hoiw this functioality works. Can someone please point me to an example using Oracle as the undelying database and allows updating ot the table via a custom Web Control?

Iana Tsolova
Telerik team
 answered on 10 Jan 2011
2 answers
228 views
I am researching the best way to hook a filter button to my grid header column rather than having a filter row displayed.  The filter row takes up too much space for what we are trying to do.  My idea would be to have an ImageButton that shows the filter image.  When the user clicks this button it would launch a radwindow to capture the criteria.  

My question is this:  Should I do this as a templated column?   It seems like the only way to add controls to the header is via a template.  The downside is that beyond that the column data is just a bound data column. 

Any recommendations or samples that I can refer to?

Randy
Niraj
Top achievements
Rank 1
 answered on 10 Jan 2011
1 answer
118 views
Hi there,

I have read the article here http://demos.telerik.com/aspnet-ajax/calendar/examples/datepicker/clientapi/defaultcs.aspx in order to position the RadDatePicker popup. However, I get an error saying Telerik is Undefined due to the following code:

 

 

var startPicker = $("#<%=this.start.ClientID %>");

 

 

 

var endPicker = $("#<%=this.end.ClientID %>");

 

startPicker.set_popupDirection(Telerik.Web.RadDatePickerPopupDirection.TopRight);

endPicker.set_popupDirection(Telerik.Web.RadDatePickerPopupDirection.TopRight);

Can someone assist me in fixing this issue?

Shinu
Top achievements
Rank 2
 answered on 10 Jan 2011
1 answer
173 views
Hi,
Is there a way to add radio button to all cells of grid. Only one cell of the grid will be selected(checked) at same time. I couldn't find changing button type to radio. For normal radbutton, it  is "ButtonType="ToggleButton" ToggleType="Radio".

Think that there is a gird which has 3 columns and 3 rows.  First column's type is datetime. Other two columns' type is boolean and shown at cell as radio button.  User will be able to select only one radio of the matrix.

Regards,

view;
                   cola      colb   
date1              O        O
date2              O        O
date3              O        O


GridButtonColumn btnCol = new GridButtonColumn();
                btnCol.DataTextField = c.ToString();
                btnCol.HeaderText = dt.Columns[c].Caption;
                btnCol.HeaderStyle.Font.Bold = true;
                btnCol.ButtonType = GridButtonColumnType.LinkButton;
                rgridDeliveryDate.MasterTableView.Columns.Add(btnCol);
Princy
Top achievements
Rank 2
 answered on 10 Jan 2011
1 answer
210 views
Hi 
On my RadGrid i have some bound columns and some template columns.
I want to simply save all my RadGrid data into my sql datatable on a button click. 
Can anybody send some sample code for that using RadGrid.

Code for my radgrid is-

<telerik:RadGrid ID="GD_Prod" runat="server" AllowPaging="True" ShowHeader="False"
                    AutoGenerateColumns="False"  GridLines="None"
                    Height="173px" Skin="Outlook" Width="1107px">
                    <ClientSettings AllowColumnsReorder="True">
                        <Selecting AllowRowSelect="True" />
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                    </ClientSettings>
                    <MasterTableView PageSize="5" >
                        <RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
    <Columns>
        <telerik:GridBoundColumn DataField="port_recipe_num" HeaderText="Recipe #" SortExpression="port_recipe_num"
            UniqueName="port_recipe_num" DataType="System.Char">
            <HeaderStyle Width="17px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="DESC_ALT" HeaderText="Description" SortExpression="DESC_ALT"
            UniqueName="DESC_ALT" DataType="System.Char">
            <HeaderStyle Width="36px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="port_no_servings" HeaderText="Portion Size" SortExpression="port_no_servings"
            UniqueName="port_no_servings" DataType="System.Char">
            <HeaderStyle Width="16px" />
        </telerik:GridBoundColumn>
        <telerik:GridTemplateColumn UniqueName="PL_STUDENT_Portions_Planned" DataType="System.Int32">
            <ItemTemplate>
                <asp:TextBox ID="TxtSTUPort" DataField="PL_STUDENT_Portions_Planned" runat="server"
                    Height="16px" Width="30px"></asp:TextBox>
            </ItemTemplate>
            <HeaderStyle Width="19px" />
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn UniqueName="PL_Adults_ALC_Portions_Planned" DataType="System.Int32">
            <ItemTemplate>
                <asp:TextBox ID="TxtAAPort" DataField="PL_Adults_ALC_Portions_Planned" runat="server"
                    Height="16px" Width="30px"></asp:TextBox>
            </ItemTemplate>
            <HeaderStyle Width="19px" />
        </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn DataField="STD_NUM_OF_SERVING" DataType="System.Int32" HeaderText="STD_NUM_OF_SERVING"
            SortExpression="STD_NUM_OF_SERVING" UniqueName="STD_NUM_OF_SERVING">
            <HeaderStyle Width="14px" />
        </telerik:GridBoundColumn>
        <telerik:GridTemplateColumn UniqueName="PL_Factor_Portions" DataType="System.Char">
            <ItemTemplate>
                <asp:TextBox ID="TxtFPort" DataField="PL_Factor_Portions" runat="server" Height="16px"
                    Width="30px"></asp:TextBox>
            </ItemTemplate>
            <HeaderStyle Width="18px" />
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn UniqueName="DOC_Quantity_Of_Food_Used" DataType="System.Char">
            <ItemTemplate>
                <asp:TextBox ID="TxtQoFUsed" DataField="DOC_Quantity_Of_Food_Used" runat="server"
                    Height="16px" Width="30px"></asp:TextBox>
            </ItemTemplate>
            <HeaderStyle Width="20px" />
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn UniqueName="DOC_Portions_Prepared" DataType="System.Int32">
            <ItemTemplate>
                <asp:TextBox ID="TxtPPort" DataField="DOC_Portions_Prepared" runat="server" Height="16px"
                    Width="30px"></asp:TextBox>
            </ItemTemplate>
            <HeaderStyle Width="16px" />
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn UniqueName="DOC_Portions_Brought_Forward" DataType="System.Int32">
            <ItemTemplate>
                <asp:TextBox ID="TxtBFPort" DataField="DOC_Portions_Brought_Forward" runat="server"
                    Height="16px" Width="30px"></asp:TextBox>
            </ItemTemplate>
            <HeaderStyle Width="16px" />
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn UniqueName="DOC_Portions_LeftOver" DataType="System.Int32">
            <ItemTemplate>
                <asp:TextBox ID="TxtLOPort" DataField="DOC_Portions_LeftOver" runat="server" Height="16px"
                    Width="30px"></asp:TextBox>
            </ItemTemplate>
            <HeaderStyle Width="16px" />
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn UniqueName="DOC_LeftOver_Code" DataType="System.Char">
            <ItemTemplate>
                <asp:DropDownList ID="ddlLOCode" DataField="DOC_LeftOver_Code" runat="server" Font-Size="10px"
                    Height="16px" Width="46px">
                    <asp:ListItem>CF</asp:ListItem>
                    <asp:ListItem>DIS</asp:ListItem>
                    <asp:ListItem>ALC</asp:ListItem>
                    <asp:ListItem>RTB</asp:ListItem>
                    <asp:ListItem>RTF</asp:ListItem>
                </asp:DropDownList>
            </ItemTemplate>
            <HeaderStyle Width="16px" />
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn UniqueName="DOC_Total_Portions_Served" DataType="System.Int32">
            <ItemTemplate>
                <asp:TextBox ID="TxtTSPort" DataField="DOC_Total_Portions_Served" runat="server"
                    Height="16px" Width="30px"></asp:TextBox>
            </ItemTemplate>
            <HeaderStyle Width="16px" />
        </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn UniqueName="POSStudents"
            DataType="System.Int32" DataField="POSStudents" HeaderText="POSStudents" 
            SortExpression="POSStudents">
            <HeaderStyle Width="18px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn UniqueName="POSAdultsALC"
            DataType="System.Int32" DataField="POSAdultsALC" HeaderText="POSAdultsALC" 
            SortExpression="POSAdultsALC">
            <HeaderStyle Width="16px" />
        </telerik:GridBoundColumn>
    </Columns>
    <PagerStyle AlwaysVisible="True" />
</MasterTableView>
                </telerik:RadGrid>
Shinu
Top achievements
Rank 2
 answered on 10 Jan 2011
2 answers
119 views
I am new to Telerik - and fairly new to ASP.NET - so please bare with me...

I have one master grid - and one detail grid.  In the detail grid I have a hyperlink (Link Button).

This hyperlink is meant to open an Image (PDF) in my SQL database.  

I figured I would do this by sending the value of the clicked item (a GUID) to the code behind - so I can then search for the image and open it up. Whatever I do, I can't figure out how to pass the GUID that was selected to the code behind.

I was able to get the value of every GUID in the column - but not the one I selected.  Could anyone steer me on the right path?  I have spent days trying to do this - I would think that this should be fairly easy...

HTML
<asp:LinkButton runat="server" CausesValidation="false" CommandName="Select"
    Text="View"></asp:LinkButton>

VB.NET
Protected Sub RadGrid2_SelectedIndexChanged(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles RadGrid2.SelectedIndexChanged
 
    Dim gridDataItem As GridDataItem = TryCast(e.Item, GridDataItem)
    If e.Item.OwnerTableView.GetColumnSafe("GUID") IsNot Nothing Then
 
        Dim cell As TableCell = TryCast(gridDataItem("GUID"), TableCell)
    End If
End Sub
Samantha
Top achievements
Rank 1
 answered on 10 Jan 2011
1 answer
121 views
Hi Telerik,


I want to set width and behaviors of ImageManager in RadEditor, but I don't find any properties to change ImageManager look like


RadEditor1.ImageManager.Behaviors = WindowBehaviors.Move | WindowBehaviors.Close | WindowBehaviors.Maximize | WindowBehaviors.Resize;
RadEditor1.ImageManager.Width = Unit.Pixel(1366);


This problem is similar to FlashManager, DocumentManager, TemplateManager, MediaManager
Rumen Jekov
Top achievements
Rank 1
 answered on 10 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?