Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
127 views
Here is my scenerio:

I have a RadGrid that is populated by data.
The first column of the radgrid has an imagebutton and that imagebutton will click off a contextmenu that will be filled depending on the DataItem in the row.

Currently, each row item is added in the ItemDataBound event ... e.Item.DataItem and that is set to an Order object.  That order object is passed into a Method that sorts out the items and builds a dictionary GetList(Order order).  That GetList is set to the RadContextMenu Datasource.  So for each row in the first column, that image button context menu might have different items.

My problem is this:  

I originally had the imagebutton and contextmenu in a user control.  It was showing the context menu fine, and the items were added correctly.  But I was getting an "undefined" javascript error.  Basically you had to click the image before the context menu would load...after that you would have "right-click access".  

Then I moved the context menu and image button back into the radgrid directly on the page.  Now the context menu doesn't work at all.

Am I missing something here?  Do I have use the ajaxmanager?  Will that even work in my scenerio with me having an image object in the first column of a radgrid?


**** Update
Found the answer.  It was an old RadGrid in the usercontrol from the designer file that was messing it up.  Took that out and made sure the sender event from the usercontrol was cast correctly.
Matt Sipes
Top achievements
Rank 1
 asked on 29 Apr 2009
4 answers
187 views
Hi folks
I think I have stumbled on a bug - wonder if you could advise....
I have set my grid to data bind on the client side using a WCF service. My grid has a nested view template which has a few labels in it. When the grid is re-bound, any nested rows which were visible seem to stay with the grid even after it is re-bound (so you end up with the new results + the previously visible nested rows). To repro the bug:
1.  Data bind the grid so that there are records in it.
2.  Expand a few of the nested rows and leave them visible.
3.  Force the grid to re-bind on the client side.
Notice now the visible nested rows haven't been removed.

Here is the code I am using to do the binding:
Grid settings:
            <ClientSettings>
                <DataBinding Location="~/Services/Anonymous/Reporting/OnDemandLatest.svc" SelectMethod="GetData"
                    SelectCountMethod="GetCount" EnableCaching="false" StartRowIndexParameterName="startIndex"
                    MaximumRowsParameterName="maxRowCount" />
                <ClientEvents OnDataBinding="Grid_DataBinding" OnRowDataBound="Grid_RowDataBound"
                    OnDataBound="Grid_DataBound" />
            </ClientSettings>

JS code (this is called on a button click)
            function Rebind() {
                 ShowLoadingPanel();
                 Grid().get_masterTableView().rebind();  // Note: Grid() is just a function which returns the grid.
            }
William
Top achievements
Rank 1
 answered on 28 Apr 2009
4 answers
194 views
Hello. I moved my site to another server and now, when I try to upload a file via Rad Upload script here is what i get.
" Retrieving the COM class factory for component with CLSID {FC7A96B0-4DEC-11D4-9C83-0080ADA78DDF} failed due to the following error: 80040154."
Upon further inspection I got on this page: http://support.persits.com/show.asp?code=PS071016166
I talked to the support from there and I was told that the component DLL was not registered on my server so I ordered it and now am waiting to get the download instructions.

So, i just want to make sure this error is not caused by Rad Upload. The script hasn't been touched, just the server was changed. Any opinions ?
ManniAT
Top achievements
Rank 2
 answered on 28 Apr 2009
1 answer
210 views
Hi,

I want to use RadTextbox to achieve the following solution:
http://www.pp-p.net (Type OK into the textbox)

My Problem(s) - I can't find an event for KeyUp - I found this post:
http://www.telerik.com/community/forums/aspnet-ajax/input/showing-error-style-programmatically.aspx
But when I hover the control or type focus it - the error display disappears.
I guess there are some styles :focus or other like this -- BUT it is hard to figure this out - and you (I'm sure) know which styles are involved.

I further guess there is a script which changes the class .riError to riFocus or some kind of .riHover - can this script be disabled?

Or is the solution so much effort that it is better to do it "my way" by using a hidden RadInput (to get the styles) and use a default input?

Regards

Manfred
ManniAT
Top achievements
Rank 2
 answered on 28 Apr 2009
2 answers
223 views
So, I've been digging though the forums, looking for a solution, and havent found one yet. There might be a better solution for what I'm doing, and if there is, let me know. Otherwise, here goes.

I'm using the RadGrid from the RadControls Q3 2008. This grid lists the status of some items, and has two linkbuttons "Approve", and "Deny". In either case, when one of those buttons is clicked a RadWindow pops-up, and prompts the user to enter in a reason for the approve, or the deny. Problem is, when the rad-window closes, the ItemCommand event for the Grid never fires. The ItemCommand method is where my logic for persisting it to the database goes. How do I get this event to fire? I'm using the ItemCreated method to create the OnClientClick method. This brings me to another issue. I want to send the value of one of the GridCells to the RadWindow, I figure I'll modify the URL in the case as it's passed to the radwindow. ?id=14 for instance. I need to code that in the OnClientClick, but I dont think the Gird has those values yet. Here is the code I have:

The JavaScript on the main page:
    <telerik:RadCodeBlock ID="RCB" runat="server">  
        <script type="text/javascript">  
            function ShowInsertForm(rowNum)  
            {  
                window.radopen("approvalcomments.aspx?id=" + rowNum + "", null);  
                //window.radopen(null, "radWindowComments");  
                return false;  
            }  
              
            function OnClientClose(radwindow)  
            {  
                if (radwindow != undefined) {  
                    var oValue = radwindow.argument;  
                    //alert(oValue);  
                    alert("I Fired");  
                    ///return true;  
                    var aplhie = '<% = Label1.ClientID %>';  
                    var lbl = document.getElementById(aplhie);  
                    lbl.innerHTML = "If I could, I would update that row you just clicked on, adding the comments: " + oValue;  
                }    
            }  
        </script>  
    </telerik:RadCodeBlock> 

The grid on the main page:
        <telerik:RadGrid ID="grid_Approval" runat="server" TabIndex="5"   
            Skin="Office2007" AllowMultiRowSelection="True" AllowSorting="True"   
            DataSourceID="oDataSource" GridLines="None" OnItemCommand="grid_Approval_ItemCommand" OnItemCreated="grid_Approval_ItemCreated" Ena >   
<HeaderContextMenu> 
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
</HeaderContextMenu> 
 
<MasterTableView DataSourceID="oDataSource" autogeneratecolumns="False">  
    <Columns> 
        <telerik:GridButtonColumn  
            CommandName="Approve" 
            Text="Approve" 
            UniqueName="Approve">  
        </telerik:GridButtonColumn> 
        <telerik:GridButtonColumn  
            CommandName="Deny" 
            Text="Deny" 
            UniqueName="Deny">  
        </telerik:GridButtonColumn> 
        <telerik:GridBoundColumn DataField="ID" HeaderText="ID"   
            SortExpression="ID" UniqueName="ID">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="EMP_ID" HeaderText="EMP_ID"   
            SortExpression="EMP_ID" UniqueName="EMP_ID">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="ADDRESS" HeaderText="ADDRESS"   
            SortExpression="ADDRESS" UniqueName="ADDRESS">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="JOB_NUMBER" HeaderText="JOB_NUMBER"   
            SortExpression="JOB_NUMBER" UniqueName="JOB_NUMBER">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="JUSTIFICATION" HeaderText="JUSTIFICATION"   
            SortExpression="JUSTIFICATION" UniqueName="JUSTIFICATION">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="AMOUNT" DataType="System.Decimal"   
            HeaderText="AMOUNT" SortExpression="AMOUNT" UniqueName="AMOUNT">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="PC" HeaderText="PC" SortExpression="PC"   
            UniqueName="PC">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="AWARD_NAME" HeaderText="AWARD_NAME"   
            SortExpression="AWARD_NAME" UniqueName="AWARD_NAME">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="CREATOR" HeaderText="CREATOR"   
            SortExpression="CREATOR" UniqueName="CREATOR">  
        </telerik:GridBoundColumn> 
    </Columns> 
</MasterTableView> 
 
<FilterMenu> 
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
</FilterMenu> 
        </telerik:RadGrid> 


The .cs for the main page:
    protected void grid_Approval_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)  
    {  
        string theCmd = e.CommandName.ToString();  
        if (theCmd == "Deny")  
        {  
            Label1.Text = "You are going to deny item " + e.Item.Cells[4].Text;  
        }  
        if (theCmd == "Approve")  
        {  
            Label1.Text = "You are going to approve item " + e.Item.Cells[4].Text;  
 
        }  
    }  
 
    protected void grid_Approval_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)  
    {  
        if (e.Item is Telerik.Web.UI.GridDataItem)  
        {  
            Telerik.Web.UI.GridDataItem dataItem = e.Item as Telerik.Web.UI.GridDataItem;  
            LinkButton button = dataItem["Approve"].Controls[0] as LinkButton;  
 
            Label1.Text = e.Item.RowIndex.ToString();  
            button.OnClientClick = String.Format("return ShowInsertForm();");  
            button.Attributes["href"] = "#";  
        }  
    } 

Ideas?
Thanks
Casey
Top achievements
Rank 1
 answered on 28 Apr 2009
6 answers
435 views
Hello there---

I have set the PagingStyle-Mode to NextPrevAndNumeric and the numbers trigger the next page successfully, but the arrows do not. The only post (http://www.telerik.com/community/forums/aspnet-ajax/grid/viewstate-and-paging.aspx) I found in the forum regarding this issue did not completely address the solution I need. It references the use of a radUpdatePanel, which I can't find in the suite of controls. I tried implementing a RadAjaxPanel and I am currently using an ASP.NET UpdatePanel, but neither seems to get the arrows working properly. Can anyone shed any light on it for me?

Thanks!

---Keith

<telerik:RadGrid ID="radGrdRequests" runat="server" AllowPaging="True"   
                PageSize="3" PagerStyle-Mode="NextPrevAndNumeric"   
                AutoGenerateColumns="False" Width="95%" HorizontalAlign="Center"   
                Skin="Office2007" ClientSettings-Selecting-AllowRowSelect="true"   
                AllowMultiRowSelection="True" GridLines="None"> 

Keith
Top achievements
Rank 1
 answered on 28 Apr 2009
8 answers
375 views
Hi,

I am having problems with populating a dynamically created GridDropDownColumn.  It is not getting populated.

I am doing everything from the codebehind. I am creating a Grid. then adding columns-Checkbox, dropdowns and textboxes.

case 12:  // Implies DropDownList Column
                                dropDownColumn = new GridDropDownColumn();                              
                                dropDownColumn.HeaderText = ListTableColumn[varLoop].Title;
                                dropDownColumn.DataField = ListTableColumn[varLoop].ColumnName;
                           //     dropDownColumn.DataSourceID = "SqlDataSource1";
                                dropDownColumn.ListTextField = ListTableColumn[varLoop].ColumnName;
                                dropDownColumn.ListValueField = ListTableColumn[varLoop].ColumnName;                     
                                dropDownColumn.UniqueName = ListTableColumn[varLoop].ColumnName;
                               grdMain.MasterTableView.Columns.Add(dropDownColumn);


Though the GridBoundColumn and the GridCheckBoxColumn get populated, the dropdown column shows me an empty column. Even when i get into the edit mode, the dropdown does not have any values.
Do I need to use an ItemDataBound event handler? I tried this but was not sucessfull.

Can someone please help me with this?

Thanks.


ketan reddy
Top achievements
Rank 1
 answered on 28 Apr 2009
2 answers
64 views
Hi,

I know that it's possible to get the ViewStartDate and ViewEndDate for a calendar view, server side. And I was wondering whether or not there is also a method for getting this on the client side as well?

Thanks,
Enoch

Enoch
Top achievements
Rank 1
 answered on 28 Apr 2009
2 answers
115 views
Got this working as a proof of concept in IE and then jumped over to Firefox and poof... nothing.

I'm opening radwindow from my "a" tags with:

    a href="/" onclick="showDetails(this); return false;">Click Me First!</a>

And my javascript for showDetails is:

  <telerik:radcodeblock id="codeDetails" runat="server">
   <script type="text/javascript">
    function showDetails(link)
    {
     var ownd = radopen(link.href, "prodDetails");
     ownd.show();
    }
   </script>
  </telerik:radcodeblock>

Tried with and without ownd.show()... was just trying to make it all work!

And my radwindowmanager is:

  <telerik:radwindowmanager id="radWindow" runat="server" visible="true" visiblestatusbar="false" height="600" width="500" destroyonclose="true" showcontentduringload="false" behaviors="Close,Move"></telerik:radwindowmanager>

Firefox is 3.0.9.
IE is 7.

What's the trick here?   In Firefox, the link simply changes the current page and no window is opened.
Kevin
Top achievements
Rank 1
 answered on 28 Apr 2009
0 answers
71 views
Hello,

I'm working with Q1 2009 Rad Tools.

I was having problems with misalignment of the images used for swapping states especially on hover.  The images were offset by a pixel or two.  Everything was perfect in FireFox version 3.0.10 but the images were offset in IE8 running in both version 8 and version 7 mode.

Problem solved!  At some point the page zoom in IE was set to 102% and throwing everything off. 

Totally my mistake, I'm not sure how I managed to adjust the zoom to 102% but for future reference if things don't line up ever so slightly check the page zoom first.

Thank you,
Bob









Robert
Top achievements
Rank 1
 asked on 28 Apr 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?