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

I'm not able to use the built in forms on the scheduler, what I have instead is a modal pop up, that I use to add / edit appointments. This works well.

What is missing is the ability to select a date / time range from the scheduler and have these populate the form. Is it possible to capture these data and send to the JS routine that opens the modal pop up?

Andy
Hristo Valyavicharski
Telerik team
 answered on 17 Nov 2014
9 answers
392 views
Hi,

I am using the RadGrid and am inserting an image into a GridBoundColumn using the ItemDataBound event, this all works fine. However when I click on a column to sort all the text columns are sorted correctly but the images do not move.

Am I missing something?


 

<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="true" AutoGenerateColumns="False" CssClass="RadGrid" GridLines="None" GroupingEnabled="False" HorizontalAlign="NotSet" OnItemDataBound="RadGrid1_ItemDataBound" OnNeedDataSource="RadGrid1_NeedDataSource" PageSize="20" ShowStatusBar="True" Skin="Office2007">  
        <HeaderStyle CssClass="RadGridHeader" /> 
        <PagerStyle Mode="NextPrevAndNumeric" /> 
        <MasterTableView CommandItemDisplay="None" GridLines="None" AllowMultiColumnSorting="True">  
            <Columns> 
                <telerik:GridBoundColumn DataField="ImagePath" HeaderText="" ReadOnly="True" SortExpression="ImagePath">  
                </telerik:GridBoundColumn> 
                <telerik:GridHyperLinkColumn DataNavigateUrlFields="InterviewerID" DataNavigateUrlFormatString="InterviewerAdministration.aspx?id={0}" DataTextField="FullName" HeaderText="Name" SortExpression="FullName" UniqueName="FullName">  
                </telerik:GridHyperLinkColumn> 
                <telerik:GridBoundColumn DataField="InterviewerRegionName" HeaderText="Region" ReadOnly="True" SortExpression="InterviewerRegionName" UniqueName="InterviewerRegionName">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="PostCode" HeaderText="Post Code" ReadOnly="True" SortExpression="PostCode" UniqueName="PostCode">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="RoleType" HeaderText="Primary Role" ReadOnly="True" SortExpression="RoleType" UniqueName="RoleType">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="HomeTelephoneNumber" HeaderText="Telephone Number" ReadOnly="True" SortExpression="HomeTelephoneNumber" UniqueName="HomeTelephoneNumber">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="EmailAddress" HeaderText="Email" ReadOnly="True" SortExpression="EmailAddress" UniqueName="EmailAddress">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="AlertType" HeaderText="Alert Type" ReadOnly="True" SortExpression="AlertType" UniqueName="AlertType">  
                </telerik:GridBoundColumn> 
            </Columns> 
        </MasterTableView> 
    </telerik:RadGrid> 

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
{  
    if (e.Item is GridDataItem)  
    {  
        string sPath = ConfigurationManager.AppSettings["ImagePath"];  
        string sImageName = "NoImageSelected.GIF";  
        string sToolTip = "No image available";  
 
        DataRowView view = (DataRowView)e.Item.DataItem;  
 
        if (view.DataView[e.Item.ItemIndex]["ImagePath"] != DBNull.Value)  
        {  
            sImageName = (string)view.DataView[e.Item.ItemIndex]["ImagePath"];  
            sToolTip = (string)view.DataView[e.Item.ItemIndex]["FullName"];  
        }  
 
        Image img = new Image();  
        img.ImageUrl = string.Concat(sPath, sImageName);  
        img.ToolTip = sToolTip;  
        img.Height = new Unit("100px");  
 
        ((GridDataItem)e.Item)["ImagePath"].Controls.Add(img);  
    }  
}  




Maria Ilieva
Telerik team
 answered on 17 Nov 2014
1 answer
105 views
Hi,

I have a functionality of moving items up and down same hierarchical level.

Treelist is wrapped into ajaxPanal.

Items are sorted within level according to "OrderNo"
I've added two buttons "MoveUp" and "MoveDown", which are changing item 's "OrderNo".

  protected void MoveQuestionDown(object sender, EventArgs e)
        {
            var itemId = int.Parse(((ImageButton)sender).CommandArgument);
            Presenter.MoveDown(itemId);
            QuestionsTree.Rebind();      
        }

        protected void MoveQuestionUp(object sender, EventArgs e)
        {
            var itemId = int.Parse(((ImageButton)sender).CommandArgument);
            Presenter.MoveUp(itemId);            
            QuestionsTree.Rebind();    
        }

Loadondemand is enabled.

Everything works fine until one of items is expanded and moved.
If i try to move (for example "down") expanded item with child's. it moves down but, item it was switched with cannot be expanded anymore. Expand button disappears.

Will appreciate any help.

Thank You.

Angel Petrov
Telerik team
 answered on 17 Nov 2014
1 answer
388 views
Hi,
I am trying to filter the RadGrid [Grd_Url] using a RadComboBox [Cmb_Lst_Sel] which is inside "CommandItemTemplate". The RadComboBox has CheckBoxes enable and user can select multiple checkboxes. The RadGrid needs to be selected based on the multiple selection [DataValueField="lst_id"]. How can I do that?

ASPX:
----------------------------------------------------------------------

<telerik:RadGrid ID="Grd_Url" runat="server" GridLines="None" AllowSorting="true" AllowPaging="true" PageSize="50"
    AllowFilteringByColumn="true" AutoGenerateColumns="False" AllowMultiRowSelection="true" AllowMultiRowEdit="true"
    AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowAutomaticDeletes="True" 
    DataSourceID="Sql_Url" Width="100%">
    <SortingSettings SortToolTip=""/>
    <FilterItemStyle Width="100%"></FilterItemStyle>
    <GroupingSettings CaseSensitive="false"></GroupingSettings>
    <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric"/>
    <MasterTableView DataKeyNames="url_id" CommandItemDisplay="Top" EditMode="InPlace" InsertItemPageIndexAction="ShowItemOnCurrentPage"
        GroupLoadMode="Client" GroupsDefaultExpanded="true" TableLayout="Fixed" Width="100%">
        <GroupByExpressions>
            <telerik:GridGroupByExpression>
                <SelectFields>
                    <telerik:GridGroupByField FieldName="lst_name"></telerik:GridGroupByField>
                    <telerik:GridGroupByField FieldName="lst_sort"></telerik:GridGroupByField>
                </SelectFields>
                <GroupByFields>
                    <telerik:GridGroupByField FieldName="lst_sort" SortOrder="Ascending"></telerik:GridGroupByField>
                    <telerik:GridGroupByField FieldName="lst_name" SortOrder="Ascending"></telerik:GridGroupByField>
                </GroupByFields>
            </telerik:GridGroupByExpression>
        </GroupByExpressions>
        <CommandItemTemplate>
        <div id="Div_Tlb_Fixed">
            <telerik:RadToolBar ID="Tlb_Url" runat="server" EnableImageSprites="true"
                OnButtonClick="CsTlbClick" OnClientButtonClicking="jsTlbUrl">
                <Items>
                    <telerik:RadToolBarButton CommandName="Toggle" PostBack="false" ToolTip="Expand/Collapse Folders"
                        CssClass="Btn_ToggleN" HoveredCssClass="Btn_ToggleH"
                        CheckOnClick="true" AllowSelfUnCheck="true" Group="T">
                    </telerik:RadToolBarButton>

                    <telerik:RadToolBarButton CommandName="Clear" PostBack="false" ToolTip="Clear Website Selection"
                        CssClass="Btn_ClearN" HoveredCssClass="Btn_ClearH">
                    </telerik:RadToolBarButton>
                </Items>
            </telerik:RadToolBar>
            <telerik:RadComboBox ID="Cmb_Lst_Sel" runat="server" DataTextField="lst_name" CheckBoxes="true"
                DataValueField="lst_id" AutoPostBack="True" EnableCheckAllItemsCheckBox="true" 
                DataSourceID="Sql_Lst" Width="20%">
                <Items>
                    <telerik:RadComboBoxItem Text="All" Value="" Selected="true"></telerik:RadComboBoxItem>
                </Items>
            </telerik:RadComboBox> 
        </div>
        </CommandItemTemplate>
        <Columns>
            <telerik:GridBoundColumn DataField="lst_id" HeaderText="Folder ID" SortExpression="lst_id" 
                UniqueName="lst_id" Display="false">
                <HeaderStyle HorizontalAlign="Left" Width="1%"/>
                <ItemStyle HorizontalAlign="Left" Width="1%"/>
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="lst_name" HeaderText="Folder Name" SortExpression="lst_name" 
                UniqueName="lst_name" Display="false">
                <HeaderStyle HorizontalAlign="Left" Width="1%"/>
                <ItemStyle HorizontalAlign="Left" Wrap="false" Width="1%"/>
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn DataField="url_name" HeaderText="Website Name" SortExpression="url_name" 
                UniqueName="url_name" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" 
                ShowFilterIcon="false" FilterControlWidth="100%">
                <HeaderStyle HorizontalAlign="Left" Width="25%"/>
                <ItemStyle HorizontalAlign="Left" Width="25%"/>
                <ItemTemplate>
                    <asp:HyperLink ID="Hyp_url_name" runat="server" Target="_blank" Font-Underline="false"
                        NavigateUrl='<%# Eval("url_address") %>'><%# Eval("url_name") %>
                    </asp:HyperLink>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadTextBox runat="server" ID="Gce_url_name" MaxLength="128" 
                        Text = '<%# Bind("url_name") %>' Width="100%">
                    </telerik:RadTextBox>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="url_address" HeaderText="Website Address" SortExpression="url_address" 
                UniqueName="url_address" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" 
                ShowFilterIcon="false" FilterControlWidth="100%">
                <HeaderStyle HorizontalAlign="Left" Width="47%"/>
                <ItemStyle HorizontalAlign="Left" Width="47%"/>
                <ItemTemplate>
                    <asp:HyperLink ID="Hyp_url_address" runat="server" Target="_blank" Font-Underline="false"
                        NavigateUrl='<%# Eval("url_address") %>'><%# Eval("url_address")%>
                    </asp:HyperLink>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridEditCommandColumn UniqueName="Btn_Edit" ButtonType="ImageButton" EditText="Edit" HeaderText="Edit">
                <HeaderStyle HorizontalAlign="Center" Width="7%"/>
                <ItemStyle HorizontalAlign="Center" Width="7%"/>
            </telerik:GridEditCommandColumn>
            <telerik:GridButtonColumn CommandName="Delete" UniqueName="Btn_Delete" ButtonType="ImageButton" Text="Delete"
                ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ConfirmText="Delete the selected websites(s)? You cannot UNDO the operation.">
                <HeaderStyle HorizontalAlign="Center" Width="4%"/>
                <ItemStyle HorizontalAlign="Center" Width="4%"/>
            </telerik:GridButtonColumn>
        </Columns>
    </MasterTableView>
    <ClientSettings AllowRowsDragDrop="true" AllowColumnsReorder="false" AllowKeyboardNavigation="false"
            AllowGroupExpandCollapse="true" AllowDragToGroup="false">
        <Selecting AllowRowSelect="true" EnableDragToSelectRows="true"/>
        <Resizing AllowRowResize="true" AllowColumnResize="true" AllowResizeToFit="true" EnableRealTimeResize="true" 
            ResizeGridOnColumnResize="false" ShowRowIndicatorColumn="false" ClipCellContentOnResize="false"/>
        <Scrolling AllowScroll="false" SaveScrollPosition="true"/>
        <KeyboardNavigationSettings AllowSubmitOnEnter="true"/>
        <ClientEvents OnRowDblClick="jsRowDblClick" OnRowDropping="onRowDropping"/>
    </ClientSettings>
</telerik:RadGrid>

<asp:SqlDataSource ID="Sql_Url" runat="server" OnInserting="CsSqlInserting" OnSelecting="CsSqlSelecting"
ConnectionString="<%$ ConnectionStrings:Con_Str %>" 
    DeleteCommand="DELETE FROM [t_Urls] WHERE [url_id] = @url_id" 
    InsertCommand="INSERT INTO [t_Urls] ([url_id], [usr_id], [lst_id], [url_isOpen], [url_name], [url_address], [url_sort]) 
                   VALUES (NEWID(), @usr_id, @lst_id, @url_isOpen, @url_name, @url_address, @url_sort)" 
    SelectCommand="SELECT b.[lst_id], b.[lst_name], b.[lst_sort], a.[url_id], a.[url_isOpen], a.[url_name], a.[url_address], a.[url_sort] 
                   FROM (SELECT * FROM [t_Urls] WHERE [usr_id] = @usr_id) a 
                   INNER JOIN 
                   (SELECT * FROM [t_Lists] WHERE [usr_id] = @usr_id AND [lst_type] IN ('a', @lst_type_filter)) b 
                   ON a.[lst_id] = b.[lst_id] 
                   ORDER BY b.[lst_sort] ASC, a.[url_sort] ASC, a.[url_date] DESC"
    UpdateCommand="UPDATE [t_Urls] SET [lst_id] = @lst_id, [url_isOpen] = @url_isOpen, [url_name] = @url_name, 
                   [url_address] = @url_address, [url_sort] = @url_sort WHERE [url_id] = @url_id">
    <InsertParameters>
        <asp:Parameter Name="usr_id"/>
        <asp:Parameter Name="lst_id"/>
        <asp:Parameter Name="url_isOpen" Type="Boolean" DefaultValue="true"/>
        <asp:Parameter Name="url_name" Type="String"/>
        <asp:Parameter Name="url_address" Type="String"/>
        <asp:Parameter Name="url_sort" Type="Byte" DefaultValue="1"/>
    </InsertParameters>
    <SelectParameters>
        <asp:Parameter Name="usr_id"/>
        <asp:Parameter Name="lst_type_filter" Type="String" DefaultValue="z"/>
    </SelectParameters>
    <UpdateParameters>
        <asp:Parameter Name="lst_id"/>
        <asp:Parameter Name="url_isOpen" Type="Boolean"/>
        <asp:Parameter Name="url_name" Type="String"/>
        <asp:Parameter Name="url_address" Type="String"/>
        <asp:Parameter Name="url_sort" Type="Byte"/>
    </UpdateParameters>
    <DeleteParameters>
        <asp:Parameter Name="url_id"/>
    </DeleteParameters>
</asp:SqlDataSource>

<asp:SqlDataSource ID="Sql_Lst" runat="server" OnSelecting="CsSqlSelectingCmb"
ConnectionString="<%$ ConnectionStrings:Con_Str %>"
    SelectCommand="SELECT [lst_id], [lst_name] 
                   FROM [t_Lists] 
                   WHERE [usr_id] = @usr_id 
                   ORDER BY [lst_sort]">
    <SelectParameters>
        <asp:Parameter Name="usr_id"/>
    </SelectParameters>
</asp:SqlDataSource> 


C#:
----------------------------------------------------------------------

        protected void Page_Load(object s, EventArgs e)
        {
            _isAuth = HttpContext.Current.User.Identity.IsAuthenticated;

            Sql_Url.SelectCommand = "SELECT b.[lst_id], b.[lst_name], b.[lst_sort], a.[url_id], a.[url_isOpen], a.[url_name], a.[url_address], a.[url_sort] " +
                                    "FROM (SELECT * FROM [t_Urls] WHERE [usr_id] = @usr_id) a " +
                                    "INNER JOIN " +
                                    "(SELECT * FROM [t_Lists] WHERE [usr_id] = @usr_id AND [lst_type] IN ('a', @lst_type_filter)) b " +
                                    "ON a.[lst_id] = b.[lst_id] " +
                                    "ORDER BY b.[lst_sort] ASC, a.[url_sort] ASC, a.[url_date] DESC ";
        }

        protected void CsTlbClick(object s, RadToolBarEventArgs e)
        {
        }

        protected void CsSqlInserting(object s, SqlDataSourceCommandEventArgs e)
        {
            if (_isAuth)
            {
                e.Command.Parameters["@usr_id"].Value = Membership.GetUser(HttpContext.Current.User.Identity.Name).ProviderUserKey;
            }
            else
            {
                e.Command.Parameters["@usr_id"].Value = Guid.Empty;
            }
        }

        protected void CsSqlSelecting(object s, SqlDataSourceCommandEventArgs e)
        {

             e.Command.Parameters["@usr_id"].Value = Membership.GetUser(HttpContext.Current.User.Identity.Name).ProviderUserKey;
             e.Command.Parameters["@lst_type_filter"].Value = (Session["lst_type"] != null && Session["lst_type"].ToString() != "") ? Session["lst_type"].ToString() : "z";
        }

        protected void CsSqlSelectingCmb(object s, SqlDataSourceCommandEventArgs e)
        {

            e.Command.Parameters["@usr_id"].Value = Membership.GetUser(HttpContext.Current.User.Identity.Name).ProviderUserKey;

        }

------------











Konstantin Dikov
Telerik team
 answered on 17 Nov 2014
6 answers
129 views
Is there a way to have the TreeMapItems auto resize on browser window resize? Currently if the user shrinks the browser window, it shrinks the RadTreeMap but not the TreeMapItems so they get covered up. And in reverse, it expands the size of the RadTreeMap but the TreeMapItems stay the same so it leaves a blank area to the right of the TreeMapItems.

Is there a way to fix this?
Nencho
Telerik team
 answered on 17 Nov 2014
3 answers
151 views
I currently have a combo box with a custom item template. Is there a way to cause the drop down menu to be offset left by X number of pixels. I basically don't want the combo box to open directly underneath, but instead off to the left. Wasn't sure if there was a way to do this?

Thanks,
Levi
Görkem
Top achievements
Rank 1
 answered on 16 Nov 2014
2 answers
145 views
Hi all,

How can i shift the dropdown position to left? i dont want the dropdown exactly below the combo textbox. please help me.
Görkem
Top achievements
Rank 1
 answered on 16 Nov 2014
4 answers
357 views

Hi,

Perhaps someone can help me out. I am trying to do something that should be extremely easy with OpenAccess. Complex DataBinding to a textbox. I have not been able to accomplish this with OpenAccess. I have been trying this unsuccessfully for 3-4 weeks. Does anyone know how to do this? If so, could you please post some example code. I am using SQL Server Compact 3.5 and WinForms.

I can successfully add, update, and delete records from one table in a grid. Nothing else works.

Also, Telerik support has been terrible. They take many days to give an ambiguous answer. So far they are the worst support I have encountered. I regularly deal with <admin>company name removed</admin> and <admin>company name removed</admin>. Also, I have had great success with <admin>product name removed</admin> as an ORM. This product works very well however crud is painful (lots of code). This is why I was interested in OpenAccess. Telerik advertises it as great for CRUD. I'm hoping someone can help me before I throw this product in the garbage.

Rene

Olivier
Top achievements
Rank 2
 answered on 16 Nov 2014
4 answers
529 views
I've 10 dropdownlist in one page. I want to bind this dropdownlists from client side. In jquery I just pass the dropdownlists id using ajax from client side to server side then I bind the data using jquery. But in telerik how can I do that. I am new here. So I don't know how to do that. Can any one help me please.
Jahangir
Top achievements
Rank 2
 answered on 16 Nov 2014
1 answer
551 views
Hi,

i have an issue with maintaining state of template column textbox on paging in radgrid.
I am storing the data in session and then on need datasource event trying to get the data again from session.
But this does not help.
Please help me its urgent issue.please refer code below-






<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadGrid ID="grChecklist1" runat="server"  AutoGenerateColumns="false"
            onneeddatasource="grChecklist1_NeedDataSource" 
        onpageindexchanged="grChecklist1_PageIndexChanged" >
   <MasterTableView  AllowPaging="true" AutoGenerateColumns="false"  PageSize="5"> 
    <Columns>
    <telerik:GridTemplateColumn DataField="Number" HeaderText="Number" Visible="true">
    <ItemTemplate>
         <asp:TextBox ID="txtNumber" runat="server" Text='<%#Bind("Number")%>'/>
    </ItemTemplate>
   </telerik:GridTemplateColumn>
    <telerik:GridTemplateColumn DataField="TaskDescription" HeaderText="TaskDescription" Visible="true">
    <ItemTemplate>
         <asp:TextBox ID="txtTaskDescription" runat="server" Text='<%#Bind("TaskDescription")%>' />
    </ItemTemplate>
   </telerik:GridTemplateColumn>
   </Columns>

</MasterTableView>
</telerik:RadGrid>
   

protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadDetails();
            }
        }

        private void LoadDetails()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("Number",typeof(string));
            dt.Columns.Add("TaskDescription", typeof(string));
            dt.Rows.Add("1", "task1");
            dt.Rows.Add("2", "task2");
            dt.Rows.Add("3", "task3");
            dt.Rows.Add("4", "task4");
            dt.Rows.Add("5", "task5");
            dt.Rows.Add("6", "task6");
            dt.Rows.Add("7", "task7");
            //grChecklist.DataSource = dt;
           // grChecklist.DataBind();
            Session["dt"] = dt;

        }

        private void RefreshSessionState()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("Number", typeof(string));
            dt.Columns.Add("TaskDescription", typeof(string));
            
            foreach (GridDataItem item in grChecklist1.Items)
            {
              string number=(item.FindControl("txtNumber") as TextBox).Text;
              string task = (item.FindControl("txtTaskDescription") as TextBox).Text;
              dt.Rows.Add(number,task);
            }
            if (Session["dt"] != null)
                Session.Remove("dt");
            Session["dt"] = dt;
        }

       

        protected void grChecklist1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
           // RefreshSessionState();
            grChecklist1.DataSource = (DataTable)Session["dt"];

        }

        protected void grChecklist1_PageIndexChanged(object sender, GridPageChangedEventArgs e)
        {
            grChecklist1.AllowPaging = false;
            grChecklist1.Rebind();
           // RefreshSessionState();
           
            grChecklist1.CurrentPageIndex = e.NewPageIndex;
            grChecklist1.AllowPaging = true;
            grChecklist1.Rebind();
        }
    }
Jayesh Goyani
Top achievements
Rank 2
 answered on 15 Nov 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?