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

I have a rad grid in my page. I need to provide filter option for 4 columns. we need only "EqualTo" filter.

What i need is that, filter button should show in the header. And will clicking on the button, the options should not show. While clicking on the button, the grid should filter for "EqualTo" filter function.

The code we have wrritten given below. But its showing the filter menu. Please help.
Thanks in advance.

<telerik:GridTemplateColumn UniqueName="Column1" SortExpression="Column1" 
    HeaderStyle-ForeColor=
"#245E9E" HeaderText="Column 1" ItemStyle-Wrap="true" Resizable="true"
    AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" DataField="Column1"
    FilterImageUrl="_layouts/Images/CoreSystem.LayoutsApp/filter.png">
     <ItemTemplate>
         <asp:Label ID=
"LblColumn1" Text='<%#Eval("Column1")%>' runat="server"></asp:Label>
     </ItemTemplate>
     <HeaderStyle Width=
"280px" />
     <ItemStyle Font-Names=
"Arial" Font-Size="11px" Wrap="true" />
    </telerik:GridTemplateColumn>

Andrey
Telerik team
 answered on 16 Aug 2013
1 answer
112 views
Hi there ,
I have a page with client side code only.
On a button click (using javascript) I want to check if inputs are valid , and if so , execute the javascript (in my case , changing tab on form)
How can I do it?

<asp:TextBox ID="tbFirstName" runat="server" Font-Size="1em" style="width: 150px;" ></asp:TextBox>
 
<telerik:RadInputManager ID="RadInputManager1" runat="server" Skin="Office2007" >
     <telerik:TextBoxSetting BehaviorID="TextBoxBehavior1" EmptyMessage=""  Validation-IsRequired="true" >
         <TargetControls>
             <telerik:TargetInput ControlID="tbFirstName" />
         </TargetControls>
         <ClientEvents OnValidating="onValidating" />
     </telerik:TextBoxSetting>       
</telerik:RadInputManager>

And this is the javascript I want to run in case the input is valid (while clicking on button)

function GeneralContinue() {
    tabStrip = $find('RadTabStrip1');
    tabStrip.findTabByValue('General').select();
}
Shinu
Top achievements
Rank 2
 answered on 16 Aug 2013
1 answer
76 views
I watched the video of Visual Style Builder and followed all the instructions but the styles are not working in my project. I tested a simple button control and when I mouseover the button changes to a color but when it's just sitting there the button has a white background.  It doesn't use the style I created with VSB.  I am using IE10. I also tested it with Chrome and Firefox with the same results.
Stamo Gochev
Telerik team
 answered on 16 Aug 2013
0 answers
97 views
Hi,
how to Maintain the state(userid) of checked records  during paging in rad grid?
Below is my code for reference
<telerik:RadGrid ID="RadGrid1" runat="server" AllowMultiRowSelection="True" AllowPaging="True"
          PageSize="5" AllowSorting="True"
          OnNeedDataSource="RadGrid1_NeedDataSource" CellSpacing="0"
          GridLines="None" ShowGroupPanel="True">
          <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true"></PagerStyle>
          <ClientSettings Selecting-AllowRowSelect="true" AllowDragToGroup="True">
              <Selecting AllowRowSelect="True"></Selecting>
          </ClientSettings>
          <MasterTableView DataKeyNames="UserId">
              <Columns>
                  <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" />
              </Columns>
              <PagerStyle AlwaysVisible="True"></PagerStyle>
          </MasterTableView>
      </telerik:RadGrid>
      <br />
      <asp:Button ID="Button1" runat="server" Text="Save" OnClick="Button1_Click" Width="130px"
          Height="25px" ValidationGroup="val" />
      <br />
and
public partial class GroupUserCreation : System.Web.UI.Page
{
    Globas obj = new Globas();
    CheckBox chkbox = new CheckBox();
    string GroupId="";
  
 
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
 
            DataTable dt1 = obj.GroupDetails();
            cmbgroupname.DataSource = dt1;
            cmbgroupname.DataTextField = "GroupName";
            cmbgroupname.DataValueField = "GroupId";
            cmbgroupname.DataBind();
        }
      
        
    }
 
    protected void Button1_Click(object sender, EventArgs e)
    {
         
        try
        {
            GroupId = cmbgroupname.SelectedItem.Value.ToString();
            foreach (GridItem item in RadGrid1.MasterTableView.Items)
            {
 
                GridDataItem dataitem = (GridDataItem)item;
                TableCell cell = dataitem["ClientSelectColumn"];
                CheckBox checkBox = (CheckBox)cell.Controls[0];
                if (checkBox.Checked)
                {
                    int userid = Convert.ToInt32(dataitem.GetDataKeyValue("UserId").ToString());
                    if (GroupId != null)
                    {
                        obj.InsertGroupUserCreation(Convert.ToInt32(GroupId), userid);
                    }
                }
 
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
     
    protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        DataTable dt = obj.UserDetails();
        RadGrid1.DataSource = dt;
      
    }
 
 
     
}

Thanks.
Swapnil
Top achievements
Rank 1
 asked on 16 Aug 2013
1 answer
78 views
If I add the event to the RadDatePicker control then obviously it works

<telerik:RadDatePicker runat="server" ID="MyRadDatePicker" ClientEvents-OnDateSelected="clientEvent" />


But My question is how do I add the event "ClientEvents-OnDateSelected" from the code behind of my master page when the radDatePicker is in a custom control and that control is on the master page?

I tried this but it wont work?

protected void Page_Load(object sender, EventArgs e)
{
UC1MyCustomControl.FindControl("MyRadDatePicker").ClientEvents-OnDateSelected="clientEvent";
 
}
Shinu
Top achievements
Rank 2
 answered on 16 Aug 2013
1 answer
66 views
Hi, I have a problem with the edit mode in the grid, when I click the edit button, I get only the Update and Cancel link, but the editable fields are not showing... Is there any property to show/hide the form view in edit or insert mode...? Even if I set the editMode to "PopUp", the popup window only shows the Update and Cancel buttons, but the fields don't... What can I do?

Thanks...
Sami
Princy
Top achievements
Rank 2
 answered on 16 Aug 2013
2 answers
95 views
We have a simple rotator with four images.  The control clips the sides of the left and right images (see attached graphic).  Is there some way to bunch the images up closer to avoid the clipping? 

Failing that, is there some formula to know how to size either the images or the rotator to ensure that no clipping will occur, to prevent trial and error testing?  For example, if the rotator is to be 900 pixels how wide can the images be without clipping?

<div style="height: 450px; background-color: #f0f3f6;">
    <asp:Image ImageUrl="~/images/carousel_rt.gif" ID="img_right" AlternateText="right"
        runat="server" Style="cursor: pointer; float: right; margin-top: 180px;" />
    <asp:Image ImageUrl="~/images/carousel_left.gif" ID="img_left" AlternateText="left"
        runat="server" Style="cursor: pointer; float: left; margin-top: 180px;" />
    <telerik:RadRotator ID="radCarousel1" runat="server" Width="900px" ItemWidth="575px"
        Height="430px" ItemHeight="255px" ScrollDuration="1000" FrameDuration="3000"
        RotatorType="CarouselButtons" Style="margin: 0px auto 0px auto;">
        <Items>
            <telerik:RadRotatorItem>
                <ItemTemplate>
                    <img src="images/carouselicount.jpg" />
                </ItemTemplate>
            </telerik:RadRotatorItem>
            <telerik:RadRotatorItem>
                <ItemTemplate>
                    <img src="images/carouselplatform.jpg" />
                </ItemTemplate>
            </telerik:RadRotatorItem>
            <telerik:RadRotatorItem>
                <ItemTemplate>
                    <img src="images/carouselpeople.jpg" />
                </ItemTemplate>
            </telerik:RadRotatorItem>
            <telerik:RadRotatorItem>
                <ItemTemplate>
                    <img src="images/carouselprograms.jpg" />
                </ItemTemplate>
            </telerik:RadRotatorItem>
        </Items>
        <ControlButtons LeftButtonID="img_left" RightButtonID="img_right" />
    </telerik:RadRotator>
</div>
Lisa
Top achievements
Rank 1
 answered on 15 Aug 2013
2 answers
92 views
When a new record is added in the demo link below, the dropdown does not always initialize at index 0.  It will remember the index of a previous selected row's dropdown.  How can it be made to always initialize at 0 when a new record is added? 

http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/batchediting/defaultcs.aspx
adam
Top achievements
Rank 1
 answered on 15 Aug 2013
1 answer
418 views

Hi,
I need to display customized tooltips on individual sectors of a pie chart. How can I do it in the code behind? Because I also need to customize the background color of the pie chart, I have to dynamically generate pie series in the code behind.
My code snippet is attached.

Thanks,

Rong

    Private Sub LoadAppropriationForAllPrograms()
        lblChrtHeader.Text = "Appropriation by Program"
        Dim budgetFund As New BudgetBookBAL.BudgetBook
        Dim fundDT As New DataTable
        Dim seriesColor As New BudgetBookBAL.StaticColors
        chrtProgram.PlotArea.Series.Clear()
       

        fundDT = budgetFund.GetAppropriationForAllPrograms()

        Dim chartData As New Telerik.Web.UI.PieSeries
        chartData.StartAngle = "90"
        chartData.LabelsAppearance.Position = Telerik.Web.UI.HtmlChart.PieLabelsPosition.Circle
        chartData.LabelsAppearance.DataFormatString = "${0}M"

       
        Dim total As Decimal = 0D
        For Each row As DataRow In fundDT.Rows
            total = CDec(row("TOT_BUDGET")) + total
        Next

        Dim index As Integer = 0
        For Each row As DataRow In fundDT.Rows
            Dim chartSeries As New Telerik.Web.UI.SeriesItem

            Dim pct As Decimal = 0D
            If total > 0 Then
                pct = CDec(row("TOT_BUDGET")) / total * 100
            End If

            chartSeries.BackgroundColor = seriesColor.GetColor(index)
            Dim desc As String = row("PROG_NAME").ToString + " - $" + CDec(row("TOT_BUDGET")).ToString() + "M (" + pct.ToString("F1") + "%)"

            chartSeries.YValue = CDec(row("TOT_BUDGET"))
            chartSeries.Name = desc
            'chartSeries.TooltipValue = desc
            chartData.Items.Add(chartSeries)
            index += 1
        Next
        chrtProgram.Legend.Appearance.Position = Telerik.Web.UI.HtmlChart.ChartLegendPosition.Right
 
        chrtProgram.PlotArea.Series.Add(chartData)
        chrtProgram.DataBind()
    End Sub

Danail Vasilev
Telerik team
 answered on 15 Aug 2013
1 answer
104 views
Hello,

I was wondering if it is possible to handle quotation marks in the Editor so that they work according to standards in different countries. 

In Switzerland and Germany the quotation marks should be like this: â€ž …“ but in Sweden and UK it should be like this: "...".

Is there any way of handling this without adding a keydown listener that does this manually?

Best regards

Ianko
Telerik team
 answered on 15 Aug 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?