Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
79 views
   Hi, I developed a custom asp.net user control that uploads images from a client machine to the app server. I used Telerik RadGrid. The only problem I have is not being able to drag and drop rows. I have gone through the relevant documentation online and examples and was able to simulate the same behavior but the grid in my control seems to stumble over something I have not been able to figure out. I am posting a snippet here... If it s not going to help, I can send a demo asp.net web site project and the control library project. It's C# and .NET 4.0  Thank you.
<div>
  <telerik:RadGrid
            ID="grdImageGroups"
            runat="server"
            AutoGenerateColumns="False"
            ShowFooter="true"
            Height="232px"
            Skin="Office2007"
            AllowSorting="true"
            Width="237px"
            GridLines="None"
            Visible="true"
            AllowMultiRowSelection="false"
            OnItemCommand="grdImageGroups_ItemCommand"
            OnSelectedIndexChanged="grdImageGroups_OnSelectedIndexChanged"  
            OnRowDrop="grdImageGroups_RowDrop"
            OnItemDataBound="RadGrid1_ItemDataBound">
            <MasterTableView DataKeyNames="Key" ShowHeader="true" ShowHeadersWhenNoRecords="true"  >
                 <SortExpressions>
                        <telerik:GridSortExpression FieldName="Title" SortOrder="Ascending" />
                    </SortExpressions>
                    <Columns>
                        <telerik:GridTemplateColumn UniqueName="colCheck" Visible="true" ItemStyle-Width="30px" HeaderStyle-Width="30px" >
                             <ItemTemplate>
                                <asp:CheckBox runat="server" ID="chkSelectRow" onclick="CheckRow(this);" />
                            </ItemTemplate>
                            <ItemStyle Width="15px" />
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn UniqueName="colImage" DataField="OriginalImageFile" ItemStyle-Width="30px" HeaderStyle-Width="30px">  
                           <ItemTemplate>  
                            <asp:Image ID="Image1" ImageUrl='<%# Eval("OriginalImageFile") %>' Height="20px" Width="20px" runat="server"  style="height:20px; width:20px" />  
                           </ItemTemplate>  
                        </telerik:GridTemplateColumn>  
                        <telerik:GridTemplateColumn HeaderText ="Image Name" DataField="Title"   UniqueName="colCheck" ItemStyle-Width="140px" HeaderStyle-Width="140">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblTitle" Text='<%# TruncatedTitle(Convert.ToString(Eval("Title")), 25) %>' ToolTip='<%# Eval("Title") %>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings  AllowRowsDragDrop="true" EnablePostBackOnRowClick="True">
                    <Selecting AllowRowSelect="true" EnableDragToSelectRows="false"  />
                    <ClientEvents OnRowDropped="RowDropped" OnRowSelected="RowSelected" OnRowDragStarted="displaymessage" />
                    <Scrolling AllowScroll="True" UseStaticHeaders="true" />
                </ClientSettings>
            </telerik:RadGrid>
<div>
Sergei
Top achievements
Rank 1
 asked on 24 May 2012
2 answers
277 views
I am trying to create a RadNotification from the code behind of an .aspx page but I keep getting "Object reference not set to an instance of an object."  

I am creating a new RadNotification like so:

Dim notification As New RadNotification

and then try to show it:

notification.Show()

I understand that this notification would be empty but I have also tried giving it a title and some text but that doesn't seem to work either.

What else do I have to provide?  Is it even possible to do this?


Trevor
Top achievements
Rank 1
 answered on 24 May 2012
4 answers
113 views
Hi,
I have an existing application which id devloped in ASP.NET2005 Framework 2.0(CLR 2.0) and as per the client requirement
we need to use the TELERIK Shedular control.
But I think telerik schedular control targets the CLR3.0 and above.
Is there any Schedular control exists that i can use it into my existing application without migrating the framework(as application is huge and will imact on lot of functionality).
Please suggest on this on priority.


Many Thanks
Anurag Sharma
Peter
Telerik team
 answered on 24 May 2012
1 answer
66 views
I have implemented this project as a test project:

http://www.telerik.com/help/aspnet-ajax/grid-updating-inplace-and-editforms.html

When I edit records, the edits show up in the grid... but they do not update in the northwinds database.

How do I get the updated records to write to the northwinds mdb using this code example?
ToltingColtAcres
Top achievements
Rank 2
Veteran
Iron
 answered on 24 May 2012
5 answers
405 views
Hi,
I have a RadComboBox as:
<telerik:RadComboBox ID="rcbProducts" runat="server" EmptyMessage="Select a product" AllowCustomText="true"
       AppendDataBoundItems="true" DataTextField="ProductName" ToolTip="ProductDescription"
       HighlightTemplatedItems="true">
       <ItemTemplate>
           <div onmouseover='showToolTip(this);' title='<%# Eval("ProductDescription")%>' style='width: 100%;'>
               <%# Eval("ProductName")%></div>
       </ItemTemplate>
   </telerik:RadComboBox>
I have loaded it with few items using Page_Load on server side. Now i need to add an item at client-side using javascript. How can i achieve this. This is what i have got.
function Add() {
            var combo = $find("<%= rcbProducts.ClientID %>");
            var comboItem = new Telerik.Web.UI.RadComboBoxItem();
            comboItem.set_text("New Item");
            var div = document.createElement("div");
            div.setAttribute("onmouseover", "showToolTip(this);");
            div.setAttribute("title", "New Item");
            div.setAttribute("style", "width: 100%;");
            div.innerHTML = "New Item";
            comboItem.set_element(div);//It doesnt set div as element???
            combo.get_items().add(comboItem);
            comboItem.select();
            return false;
        }
Thanks in Advance.
Cat Cheshire
Top achievements
Rank 1
 answered on 24 May 2012
6 answers
261 views
I know a grid's "caption" property can be set server-side by,

grid.MasterTableView.Caption = "my caption";

But is it also possible to set this client-side via javascript?  I tried the following but no luck,

masterTableView = grid.get_masterTableView();
masterTableView.Caption = "my caption";

Thanks in advance.
David
Top achievements
Rank 1
 answered on 24 May 2012
1 answer
131 views
Hi,

I have a grid with group headers, i need to do expand all/collapse all as well as ensure the normal expand/collapse works too. I achieved expand all/collapse all via the below js:

        var EXPAND_CSS_CLASS = "<%=CSSConstants.EXPAND_EXPERIENCE_CSS%>";//rgExpand
        var COLLAPSE_CSS_CLASS = "<%=CSSConstants.COLLAPSE_EXPERIENCE_CSS%>";//rgCollapse
       
        //Expands or collapses all group headers based on expandCollapseClass
        function ExpandCollapseAllGroups(isExpand) {
            var sourceClass = (isExpand) ? EXPAND_CSS_CLASS : COLLAPSE_CSS_CLASS;
            var destinationClass = (isExpand) ? COLLAPSE_CSS_CLASS : EXPAND_CSS_CLASS;
            var toolTip = "<%=Tokens.CandidateExpandGroupToolTipText %>";
            if (isExpand) {
                toolTip = "<%=Tokens.CandidateCollapseGroupToolTipText %>";
            }
            // change the +/- states
            $("." + sourceClass).each(function(button) {
                $(this).removeClass(sourceClass).addClass(destinationClass);
                //change the tool tip for expand/collapse buttons
                $(this).attr("title", toolTip);
            });
            // hide/show the rows
            $("#<%=m_UIExperienceGrid.ClientID %> .<%=CSSConstants.GRID_ROW_CSS %>, #<%=m_UIExperienceGrid.ClientID %> .<%=CSSConstants.GRID_ALT_ROW_CSS %>").each(
                function(button) {
                    if (isExpand) {
                        $(this).show();
                    } else {
                        $(this).hide();
                    }
            });
            //return false to prevent postbacks
            return false;
        }

The issue is, i am unable to do an individual expand/collapse due to the mark up for grid being tampered by some highlight javascript functionality built in our application which will merely add span tags around the keywords i search to highlight in my application. The keywords i search corresponds to words displayed in the header item of the grid. Once the markup is tampered, the telerik grid individual expand/collapse breaks. Hence i need to somehow remove the telerik generated expand/collapse js associated with the input tags that bear the class "rgExpand" or  "rgCollapse" and add custom js to expand/collapse the groups individually. I tried the below js, it is not working

    $(".<%=CSSConstants.EXPAND_EXPERIENCE_CSS%>, .<%=CSSConstants.COLLAPSE_EXPERIENCE_CSS%>").attr('onclick', '');
$(".<%=CSSConstants.EXPAND_EXPERIENCE_CSS%>, .<%=CSSConstants.COLLAPSE_EXPERIENCE_CSS%>").each(
        function() {
            $(this)[0].onclick = function() {
                //TODO: if you need to know if the element is expanded, use the next line of code... otherwise remove it
                //var isExpanded = $(this).attr("class") == "rgCollapse";
                $(this).parents("TR.<%=CSSConstants.GRID_ROW_GROUP_HEADER_CSS %>").next("TR").toggle();
            }
        });

Please suggest me a solution as i have pretty much exhausted all the options.

Thanks and regards,
Damodar
Pavlina
Telerik team
 answered on 24 May 2012
0 answers
83 views
I have a RadGrid in a UpdatePanel (standard .net one) which in turn is in a modal pop up. When the popup is first shown the grid displays correctly however if the popup is closed and reopened then the styling for the grid is missing, there are no gridlines. If I look at the CSS loaded for the page (using FireFox webdeveloper plugin) I can see that the CSS for the radGrid is missing on the second load, even though CSS for other rad components are there. Any idea what might cause this? The gird has visible="false" when the popup is opened and is only displayed after the user presses a button in the popup.
Water
Top achievements
Rank 1
 asked on 24 May 2012
9 answers
1.2K+ views
RadAjaxManager
<telerik:RadAjaxManager ID="ajaxManager" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="gvMemberList">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gvMemberList" LoadingPanelID="ajaxLoadingPanel" />
                     
                </UpdatedControls>
            </telerik:AjaxSetting>
         <telerik:AjaxSetting AjaxControlID="btnRefresh">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gvMemberList" LoadingPanelID="ajaxLoadingPanel" />                   
                    <telerik:AjaxUpdatedControl ControlID="tabDetails" LoadingPanelID="ajaxLoadingPanel" />                    
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
 </telerik:RadAjaxManager>
  
    <telerik:RadAjaxLoadingPanel ID="ajaxLoadingPanel" runat="server" Skin="Default">
    </telerik:RadAjaxLoadingPanel>
  
  
<asp:ImageButton ID="btnRefresh" ImageUrl="~/Images/refresh.png" OnClick="btnRefresh_Click"
                            runat="server" ToolTip="Refresh all list." />
  
<telerik:RadGrid ID="gvMemberList" runat="server" AllowPaging="True" OnInit="gvMemberList_Init"
                            AllowCustomPaging="true" AllowSorting="True" SkinsPath="RadControls/Skins" EnableAJAX="True"
                            OnSortCommand="gvMemberList_SortCommand" OnPageIndexChanged="gvMemberList_PageIndexChanged"
                            OnItemDataBound="gvMemberList_ItemDataBound" OnItemCommand="gvMemberList_ItemCommand"
                            GridLines="None" EnableEmbeddedSkins="true" PageSize="10" Visible="true" ShowStatusBar="true"
                            LoadingTemplateTransparency="45" Width="90%" CellSpacing="0" CellPadding="0"
                            AutoGenerateColumns="false" AllowFilteringByColumn="True" Skin="WebBlue">
                            <GroupingSettings CaseSensitive="false" />
                              
                            <MasterTableView DataKeyNames="EmpID" FilterItemStyle-Width="1%" AllowFilteringByColumn="true"
                                AllowMultiColumnSorting="false">
                                <Columns>
                                      
                                    <telerik:GridBoundColumn DataField="EmpName" HeaderText="EmployeeName" UniqueName="EmployeeName"
                                        HeaderStyle-HorizontalAlign="Center" FilterControlWidth="25px">
                                        <ItemStyle HorizontalAlign="Center" Width="1%" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Address" HeaderText="Emploee Address" UniqueName="Emploee Address"
                                        HeaderStyle-HorizontalAlign="Center" FilterControlWidth="25px">
                                        <ItemStyle HorizontalAlign="Center" Width="1%" />
                                    </telerik:GridBoundColumn>
                     </Columns>
                            </MasterTableView>
 </telerik:RadGrid>
  
 <telerik:RadTabStrip ID="tabMemberDetails" runat="server" Skin="WebBlue" MultiPageID="tabDetails"
                            SelectedIndex="0" Align="Justify" ClickSelectedTab="true" EnableViewState="false"
                            ReorderTabsOnSelect="true" Width="1139px" OnTabClick="tabMemberDetails_Click"
                            ScrollChildren="true">
                        </telerik:RadTabStrip>
 <telerik:RadMultiPage ID="tabDetails" ScrollBars="Auto" runat="server" SelectedIndex="0"
                            CssClass="pageView" Width="1137px" Height="470px">
 </telerik:RadMultiPage>


protected void tabMemberDetails_Click(object sender, RadTabStripEventArgs e)
{
StatusNotes control = LoadControl("~/Controls/StatusNotes.ascx") as StatusNotes;
control.btnSaveClk += new StatusNotes.btnStatus_Click(control_btnSaveClk);
}
  
 void control_btnSaveClk(object sender, EventArgs e)
{            
     btnRefresh_Click(this, new ImageClickEventArgs(0,0));
}
  
protected void btnRefresh_Click(object sender, ImageClickEventArgs e)
        {
            gvMemberList.Rebind();             
        }

I have a problem to refresh my grid using RadAjaxManager from the button click of usercontrol. I have provided a very little portion of my code here. I have a grid,tab control and a refresh button. For partial post-back, I have used RadAjaxManger. When Rows are clicked on the grid, the grid is refreshed. Similarly, when refresh button is clicked grid and tabControl is partially refreshed thru AjaxManager. Till now there is no problem while performing Ajaxifying. Now i want to refresh the grid when user clicks a button in a usercontrol. I am dynamically loading different usercontrol inside tabMemberDetails_Click based on Tabs clicked. For Simplicity lets assume I have a button inside the dynamically loaded usercontrol and btnSaveClk is the event exposed from that usercontrol. I am calling btnRefresh_Click on occurence of that button click. when i debugged the code, everthing works, btnRefresh_Click is called and NeedDataSource of gvMemberList is called and the datasource shows the lates data. But the problem is the Grid doesnt show the lates data. The problem is obvious, Its just that the controls are not being refreshed because btnRefresh didnt occur by clicking on refresh button but another event called it.
I am having this problem for long time and I need to get over it very soon. Is it true that we can refresh control with the ones specified in the AjaxSettings in RadAjaxManager.Can anyone help me.
Tsvetina
Telerik team
 answered on 24 May 2012
3 answers
115 views
Hi
This may sound stupid but i need to add a date and time to a database and am using the calendar control and the time picker as the time slots we are using are at 2 hr intervals ho do i pull the date out of the calender and the time out of the time picker and put the 2 together?

Many thanks
Larry
Top achievements
Rank 1
 answered on 24 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?