Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
601 views
Hey there,

I have a series of buttons and drop downs that I'd like to show in the header of my RadGrid using the CommandItemTemplate.  My first attempt at solving this problem involved using the RadToolBar.  This works well, except I have not been able to identify a way to position the buttons as I'd like.  Essentially, I want to be able to have the last button in the ToolBar aligned to the right.

Is there a way to use an HTML table to position the RadToolBar's Items as I'd like?  

Using standard ASP.Net controls, the essential layout I'd want can be created like this:

<table style="width: 100%"
      <tr> 
           <td> 
                <asp:DropDownList ID="SentBoxSelect" runat="server" CssClass="Normal" AutoPostBack="true" OnSelectedIndexChanged="SentBoxSelect_SelectedIndexChanged"
                   <asp:ListItem Text="All" Value="All" /> 
                   <asp:ListItem Text="None" Value="None" /> 
                 </asp:DropDownList> 
                 <asp:Button ID="btnReplySent" runat="server" CssClass="Normal" Text="Reply" /> 
               </td> 
               <td style="text-align: right"><asp:Button ID="SentTools" runat="server" CssClass="Normal" Text="Tools & Settings" OnClick="ToolsAndSettingsButton_Click" /></td
          </tr> 
</table> 

This results in a DropDownList on and a Button on the left side of the Grid's Header, and a "Tools & Settings" button aligned on the right side.

Thanks for your help,

Chris
Kate
Telerik team
 answered on 29 Mar 2012
1 answer
74 views
Hi Telerik:

This is a question perplex me.
In RadGrid,Nest a RadChart,Of course ,that data bind to radGrid.
There are two kind of think. 
        First : Through data of  radGrid takes datasource to radChart. This think source think of silverlight.
        Second: Through keyColumn of  radGrid ,Execute StoredProcedure with parameter to bind radChart. Why needing execute StoredProcedure ,Because I must process some things. The SqlDataSource seem to can't to execute  StoredProcedure with parameter.

I try to two ways,but fail.I  distressed.
So I please admin help me trying to use second way. Give me some example.
The sourcecode here:


<telerik:RadGrid AutoGenerateColumns="False" ID="RadGridFHData"
                AllowFilteringByColumn="True" AllowPaging="True"
                AllowSorting="True" runat="server" ShowGroupPanel="true"
            onitemcommand="RadGridFHData_ItemCommand">
                <PagerStyle Mode="NextPrevAndNumeric" />
                <GroupingSettings CaseSensitive="false" />
                <MasterTableView TableLayout="Fixed" DataKeyNames="FHID" ClientDataKeyNames="FHID">
                    <Columns>
                        <telerik:GridBoundColumn HeaderText="FHID" DataField="FHID" UniqueName="FHID"
                            SortExpression="FHID" HeaderStyle-Width="100px" FilterControlWidth="100px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />

                        <telerik:GridBoundColumn HeaderText="病人ID" DataField="PID" UniqueName="PID"
                            SortExpression="PID" HeaderStyle-Width="100px" FilterControlWidth="100px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />

                        <telerik:GridBoundColumn HeaderText="病人姓名" DataField="PName" UniqueName="PName"
                            SortExpression="PName" HeaderStyle-Width="100px" FilterControlWidth="100px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />

                        <telerik:GridNumericColumn  HeaderText="测量值" DataField="FHValue" UniqueName="FHValue"
                            SortExpression="FHValue" HeaderStyle-Width="100px" FilterControlWidth="140px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />

                        <telerik:GridDateTimeColumn HeaderText="测量日期" DataField="ReceiveDate" UniqueName="ReceiveDate"
                            SortExpression="ReceiveDate" HeaderStyle-Width="100px" FilterControlWidth="140px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />

                        <telerik:GridBoundColumn HeaderText="查看状态" DataField="isNew" UniqueName="isNew"
                            SortExpression="isNew" HeaderStyle-Width="100px" FilterControlWidth="140px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />

                        <telerik:GridBoundColumn HeaderText="医生留言" DataField="Remark" UniqueName="Remark"
                            SortExpression="Remark" HeaderStyle-Width="100px" FilterControlWidth="140px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />
                    </Columns>
                                        
                    <NestedViewSettings>
                        <ParentTableRelation>
                            <telerik:GridRelationFields DetailKeyField="FHID" MasterKeyField="FHID" />
                        </ParentTableRelation>
                    </NestedViewSettings>
                     <NestedViewTemplate >
                         <table>
                             <tr>
                                <td align="left" colspan="3">
                                    <telerik:RadChart ID="RadChartFH" runat="Server"
                                                      Width="495px" AutoLayout="true" Skin="Mac">
                                        <ClientSettings EnableZoom="false" ScrollMode="XOnly" XScale="4" />
                                        <Series>
                                            <telerik:ChartSeries Name="ChartFH" DataYColumn="FHValue" Type="Line">
                                                <Appearance FillStyle-MainColor="223, 87, 60">
                                                </Appearance>
                                            </telerik:ChartSeries>
                                        </Series>
                                        <Legend Visible="false"></Legend>
                                        <ChartTitle TextBlock-Text="Scrolling only (initial XScale applied)">
                                        </ChartTitle>
                                    </telerik:RadChart>

                                </td>
                             </tr>
                         </table>
                   </NestedViewTemplate>
                  
                </MasterTableView>
                <ClientSettings AllowDragToGroup="true" >
                    <Selecting AllowRowSelect="true" />
                    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                </ClientSettings>
      </telerik:RadGrid>

      <asp:SqlDataSource ID="SqlDataSource1" CancelSelectOnNullParameter="false" runat="server" ConnectionString="<%$ appSettings:XCareSqlConn%>"
           ProviderName="System.Data.SqlClient" SelectCommandType="StoredProcedure" SelectCommand="ChartFHData">
          <SelectParameters>
               <asp:Parameter  Name="FHID" Type="String"/>
           </SelectParameters>          
          
      </asp:SqlDataSource>


Maria Ilieva
Telerik team
 answered on 29 Mar 2012
0 answers
88 views
Hi,
We have a website developed using ASP.NET AJAX with Telerik controls. Telerik controls are not loading properly for few people, who are accessing the website from their laptops with wireless connections.

Users are facing this issue intermittently. I have gone through hundreds of blogs and until now there was no success. It is becoming a critical issue for us as it is affecting many people on site. Could anyone please advice?? 

Thanks,
Ram

Ram
Top achievements
Rank 1
 asked on 29 Mar 2012
2 answers
262 views
Hi,
     I have one GridEditCommandColumn and GridButtonColumn inside my radgrid.
What i want to do is, on click of both  want to open different popup to edit.
I gave command name as Edit in Gridbuttoncolumn. 
On both click its showing same mastertablevieweditform.
How to have multiple mastertablevieweditform. 

Please tell me some solution for this.


Regards,
Soumya,
Bangalore
Soumya
Top achievements
Rank 1
 answered on 29 Mar 2012
1 answer
341 views
I have the following scenario.

1) Master - Cotante Page



2) RadWindows.
When user click on "Assume User" in menu


RadWindows is open.


After user click on Assume User (I closed windows and execute ajaxManager command)

This command load Assume User in Mater/Content Page
I need show loading panel while that code is executing.

   protected void RadAjaxManager_Request(object sender, AjaxRequestEventArgs e)
        {
           switch(e.Argument.ToLower())
           {
               case "assume":
                   LoadSettings();
                   Response.Redirect("~/UI/DocumentsList.aspx");
                   break;

           }

        }


  private void LoadSettings()
        {


            Resources = App.GetRegistrationResources("Login");
            lblogOff.Text = Resources.GetString(lblogOff.ID, new CultureInfo(Culture));
            lblAssume.Text = Resources.GetString(lblAssume.ID, new CultureInfo(Culture));
            lnkCloseAssume.Text = Resources.GetString(lnkCloseAssume.ID, new CultureInfo(Culture));

            if (Session["AssumeUserId"] != null)
            {
//Here: START RADLOADING PANEL
                lblAssume.Visible = true;
                lnkCloseAssume.Visible = true;
                lblogOff.Visible = false;
                     LoadAssumeUser();  //here load user name
//Here: END RADLOADING PANEL
            }else
            {
                lblAssume.Visible = false;
                lnkCloseAssume.Visible = false;
                lblogOff.Visible = true;
            }


        }


Regards


Andrey
Telerik team
 answered on 29 Mar 2012
6 answers
425 views
Hi,

I have a nested (2-level) RadGrid sorted alphabetically by the name . After inserting a new record, I want to set the page index of the parent table to the newly created item without affecting the alphabetical sorting. I also want to automatically expand the new parent row to show its  child table. Thanks.
Raja M
Top achievements
Rank 1
 answered on 29 Mar 2012
1 answer
448 views
Hello,

  1. Understanding:
    1. In the code for the Image Gallery Demo using RadListView control, a RadBinaryImage control has been used.
    2. In the aspx page, a "onclick="<%#CreateWindowScript((TiledImages) Container.DataItem) %>"/>" event has been used.
    3. Also, if we run the program in debug mode and place a break point on the "CreateWindowScript" method defined in the code behind, we will see that this method is getting called at "Page_Load" itself.
    4. What i understand is its trying to register a Java Script for the click event when ever it occurs.
  2. Requirement:
    1. The images to be shown are stored in the data base.
    2. My requirement is that once the page is loaded and the user clicks on any of the image, I want to call a server side (code behind) method.
    3. Based on the selected Image and its ID, I want to load few other controls with data from the data base.
    4. As far as I understand, the onclick event used in the demo will not serve the purpose.
    5. What other option can I look out for for the above mentioned requirement?
    6. Note: In our project, we plan to use this image gallery in a form of a Live Tile in a ASP.NET application. And hence the usage of ListView and RadBinaryImage control.

A quick input towards the solution will be very helpful.

Regards,
Abhijit

 

Tsvetina
Telerik team
 answered on 29 Mar 2012
1 answer
128 views
Hi,

I had customized my radcalendar for displaying Hijri dates along with Gregorian.It works fine on my local machine but when hosting the Hijri dates from 13th to last date of every month is invisible.I am attaching a screenshot along with this for your reference.

Here my code is;

Protected Sub RadCalendar1_DayRender(ByVal sender As Object, ByVal e As Telerik.Web.UI.Calendar.DayRenderEventArgs) Handles radCal1.DayRender
        Dim label As New Label()
        Dim div As HtmlGenericControl = New HtmlGenericControl("div")
        div.Attributes.Add("class", "CalG")
        label.Text = e.Day.[Date].Day.ToString()  'Gregorian Day
        div.Controls.Add(label)
        Dim div1 As HtmlGenericControl = New HtmlGenericControl("div")
        div1.Attributes.Add("class", "CalH")
        Dim label1 As Label = New Label()
        label1.ForeColor = Drawing.Color.Brown
        Dim d As DateTime = e.Day.Date
        Dim objDateConv As New DatesConversion
        label1.Font.Size = FontSize.Small
        label1.Height = "5"
        label1.Text = objDateConv.GregToHijri(d, "Day") & "/" & objDateConv.GregToHijri(d, "Month")  'hijri Day and month
        div1.Controls.Add(label1)
        If e.Day.Date.DayOfWeek = 4 Then  'Disable week day
            Dim calendarSkin = radCal1.Skin
            If (calendarSkin = "") Then
                calendarSkin = "Default"
            End If
            Dim otherMonthCssClass As String = String.Format("otherMonth_{0}", calendarSkin)
            e.Cell.Text = ""
            e.Cell.CssClass = otherMonthCssClass ' set new CssClass for the disabled calendar day cells (e.g. look like other month days here)
            Dim calendarDay As RadCalendarDay = New RadCalendarDay
            calendarDay.Date = e.Day.Date
            calendarDay.IsSelectable = False
            calendarDay.ItemStyle.CssClass = otherMonthCssClass
            radCal1.SpecialDays.Add(calendarDay)
            e.Cell.BackColor = Drawing.Color.LightYellow 
        End If
        div.Attributes.Add("class", "CalG")
        div1.Attributes.Add("class", "CalH")
        e.Cell.Controls.Add(div)
        e.Cell.Controls.Add(div1)
    End Sub

Thnx in advance.
Milena
Telerik team
 answered on 29 Mar 2012
2 answers
122 views
Hi,

I have a treeList (Q3 2011) with multi column sorting enabled.
m_treeList.AllowSorting = true;
m_treeList.AllowMultiColumnSorting = true;

The first column is initially sorted:

if (!Page.IsPostBack)
{
   TreeListSortExpression sort = new TreeListSortExpression();
   sort.FieldName = "Caption";
   sort.SortOrder = TreeListSortOrder.Ascending;
   m_treeList.SortExpressions.Add(sort);
}

I have additional columns which I want to sort ("Name" and "Group") manually.
For example I have the following tree with 3 columns:

Caption | Name | Group
Caption1 (this is just a grouping node)
 + C1 | a | Group1
 + C2 | b | Group1
 + C3 | c | Group1
 + C4 |    | -

I remove the sort of the "Caption" column by clicking twice and add a sort (desc) to "Group" and a sort (asc) to "Name". I expect something like above, but I get:
Caption | Name | Group
Caption1
 + C2 | b | Group1
 + C1 | a | Group1
 + C3 | c | Group1
 + C4 |    | - 

Even if I set "Name" to "desc" it stays the same. If I set the filter just to "Name" it works (a, b, c / c, b, a).
Unfortunately I can't reproduce this with the Demo (http://demos.telerik.com/aspnet-ajax/treelist/examples/sorting/basicsorting/defaultcs.aspx ) because it doesn't have comparable data (no column has double entries).
Also, the documentation is very light regarding this topic.

Is there something else I have to do to get this to work?

Thanks!

Martin
Telerik team
 answered on 29 Mar 2012
2 answers
253 views
I have a RadListView that has an ItemTemplate that contains a RadComboBox. As such, the IDs of the combo boxes are dynamically generated, so this will not work for me:

var rcbAssigneeObject = $find("<%=rcbAssignee.ClientID %>");


. What I'm trying to do is apply some business logic to what can and cannot be selected. I'm having trouble targetting the items in the listbox. When a check box is selected, I need to use jQuery to select all items in the combobox, then check the value of an attribute that is part of the object loaded into the datasource on page load called "type". If this type is equal to, say, "person", then I need to disable all items in the combobox other whos type is "group". I've started with something like this:

$(".AssigneeTag").find(":checkbox").click(
        function () {
            var allItems = $(this).closest(".rcbList").find(".rcbItem");
            //check item types here
    });

I'm stuck on where to go from here. I seem to be unable to access any sort of item client id in order to create an asp object that allows me to manipulate the telerik object. For instance, if I were to just grab the item like:

var myItem = $(this).closest(".rcbItem").attr("id");

it would return null for that field. And if i try to get the id of the parent above that, I also get null.

Any ideas?

Or at the very least, how do I obtain the RadComboBox item starting at the checkbox OnClick event. For instance

var rcb = $(this).pathToRadComboBoxControl().Get();

The from there, how do i iterate through the item collection. is there a method like rcb.get_items().each(...);  ??
Kalina
Telerik team
 answered on 29 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?