Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
489 views

I want to delete certains rows based on a condition while binding the grid. I am using the below code. But 'item.Visible = false;'
is not working while 'item.Enabled = false;' is working.  Any idea?


protected void userGrid_ItemDataBound(object sender, GridItemEventArgs e)
{
  if (e.Item is GridDataItem)
  {
                GridDataItem item = (GridDataItem)e.Item;
                if (item["UserName"].Text.ToString() == "SuperAdmin")
                {
                                     item .Visible = false;
                                    // item.Enabled = false;
               }

   }
}

Eyup
Telerik team
 answered on 23 Jul 2015
1 answer
56 views
Hi all,
I have jquery dialog consisting of ajaxUpdatePanel, radgrid and button; when I clicked the button, ajaxLoading panel displayed behind jquery dialog. And in html code ajaxLoadingPanel is duplicated.
Maria Ilieva
Telerik team
 answered on 23 Jul 2015
1 answer
199 views

Hi,

 I have a trouble when i try binding a radcolorpicker, because this control does not show the color saved in the database.

What is wrong?

 Code .Aspx

<telerik:RadGrid id="rgCategoria"
    runat="server"
    AutoGenerateColumns="False"
    AllowAutomaticUpdates="True"
    AllowAutomaticInserts="True"
    OnNeedDatasource="rgCategoria_NeedDataSource"
    Culture="es-ES"
    GroupPanelPosition="Top"
    OnBatchEditCommand="rgCategoria_BatchEditCommand"
    OnItemCommand="rgCategoria_ItemCommand"
    OnItemDataBound="rgCategoria_ItemDataBound">
    <MasterTableView DataKeyNames="IdCategoria"
        EditMode="Batch"
        AutoGenerateColumns="False" commanditemdisplay="Top">
        <commanditemsettings
            addnewrecordtext="Nuevo"
            cancelchangestext="Cancelar"
            refreshtext="Refrescar"
            savechangestext="Guardar"
            showcancelchangesbutton="True"
            showsavechangesbutton="True">
        </commanditemsettings>
        <Columns>
            <telerik:GridBoundColumn DataField="Nombre" UniqueName="Nombre" HeaderText="Nombre">
                <HeaderStyle Width="100px"></HeaderStyle>
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn DataField="Color"
                UniqueName="Color"
                HeaderText="Color">
                <ItemTemplate>
                    <div style='width: 150px; height: 16px; background-color: <%# Eval("Color") %>'></div>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadColorPicker runat="server" ID="txtColor"
                        PaletteModes="HSB" 
                        ShowIcon="True">
                        <Localization ApplyButtonText="Aplicar" 
                            NoColorText="Ningún Color"
                            PickColorText="Elegir Color"
                            WebPaletteTabText="Paleta Web"
                            BlankColorText="Color Blanco"
                            CancelButtonText="Cancelar"
                            CustomColor="Color Personalizado"
                            HexInputTitle="Código del color hexadecimal "
                            HSBSliderDragText="Arrastrar"
                            HSVSliderDragText="Arrastrar"
                            OkButtonText="Aceptar"
                            RecentColors="Colores Recientes"
                            RGBSlidersDecreaseText="Disminuir"
                            RGBSlidersDragText="Arrastrar"
                            RGBSlidersIncreaseText="Aumentar"
                            CurrentColorText="(Color Actual es {0})"/>
                    </telerik:RadColorPicker>
                </EditItemTemplate>
 
                <HeaderStyle Width="150px">
                </HeaderStyle>
            </telerik:GridTemplateColumn>
             <telerik:GridBoundColumn DataField="IdCategoria" Display="false"></telerik:GridBoundColumn>
             <telerik:GridBoundColumn DataField="RowVersion" Display="false"></telerik:GridBoundColumn>
        </Columns>
        <BatchEditingSettings EditType="Cell" OpenEditingEvent="Click"  />
    </MasterTableView>
     
</telerik:RadGrid>

Code c#

protected void rgCategoria_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    if (ViewState["dtCategoriasColores"] != null)
    {
        rgCategoria.DataSource = (DataTable)ViewState["dtCategoriasColores"];
    }
    else
    {
        CargarCategoriaColores();
    }
}
 
protected void rgCategoria_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem && e.Item.IsInEditMode)
    {
        GridDataItem editItem = (GridDataItem)e.Item;
        RadColorPicker colorLetraRadColorPicker = (RadColorPicker)editItem.FindControl("txtColor");
        colorLetraRadColorPicker.SelectedColor = System.Drawing.ColorTranslator.FromHtml((DataBinder.Eval(e.Item.DataItem, "Color").ToString()));
    }
}
 
protected void rgCategoria_ItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.UpdateCommandName)
    {
        GridEditableItem editedItem = e.Item as GridEditableItem;
        RadColorPicker colorRCP = (RadColorPicker)editedItem.FindControl("txtColor");
        if (colorRCP != null)
            colorRCP.SelectedColor = System.Drawing.ColorTranslator.FromHtml((DataBinder.Eval(e.Item.DataItem, "Color").ToString()));
    }
}
 
protected void rgCategoria_BatchEditCommand(object sender, GridBatchEditingEventArgs e)
{
    foreach (GridBatchEditingCommand command in e.Commands)
    {
        if ((command.Type == GridBatchEditingCommandType.Update))
        {
            Hashtable newValues = command.NewValues;
            Hashtable oldValues = command.OldValues;
            string OrderID = newValues["Nombre"].ToString();
            string ShipName = newValues["Color"].ToString();
        }
    }
}

Konstantin Dikov
Telerik team
 answered on 23 Jul 2015
5 answers
339 views
Hi, when i am trying to do a toggle button without postback from the demos it works ok.
My question is: when i do an action on the OnClientCheckedChanging, it makes the toggle button do a postback. Can i click the button without postback and execute the "OnClientCheckedChanging"?

The markup:

  <telerik:RadButton ID="btnPlayPause" runat="server" ButtonType="ToggleButton" ToggleType="CheckBox"  OnClientCheckedChanging="OnClientCheckedChanging"  Width="58px" Height="59px"
AutoPostBack="false" ForeColor="Black" Checked="true" Skin="Metro">
            <ToggleStates>
                <telerik:RadButtonToggleState ImageUrl="img/play/play.png" HoveredImageUrl="img/play/playHov.png"
                    Text="Play" Selected="true"></telerik:RadButtonToggleState>
                <telerik:RadButtonToggleState ImageUrl="img/play/pause.png" HoveredImageUrl="img/play/pauseHov.png"
                    Text="Pause"></telerik:RadButtonToggleState>
            </ToggleStates>
  </telerik:RadButton>
Danail Vasilev
Telerik team
 answered on 23 Jul 2015
1 answer
81 views

hi ,

I want tile list

1 2 3 4 5 6

7 8 9 10 11 12

13 14 15 16 17

 

format.

but now its in

1 2    7 8      13 14

3 4    9 10     15 16

5 6    11 12   17

 

and i want to remove space between 2 & 7.

 

So pls give me corrwct answer.

 

Thanks & Regards,

Radian

 

Danail Vasilev
Telerik team
 answered on 23 Jul 2015
5 answers
375 views

Hi All

We're trying to update multiple RadGrid's from the client side after some user activity.

The following code works well:

var trgAppointments = $find("<%=trgAppointments.ClientID%>");
trgAppointments.get_masterTableView().rebind();

However, at the same time, we also need to update second Grid on the same page, so we try this:

// Update appointments
 var trgAppointments = $find("<%=trgAppointments.ClientID%>");
 trgAppointments.get_masterTableView().rebind();
 
 // Update progress notes
var trgProgress = $find("<%=trgProgress.ClientID%>");
trgProgress.get_masterTableView().rebind();

This doesn't work so well. The end result is:

  • trgProgress is updated. trgAppointments is not.
  • In fiddler, we see two posts two our page (one for each .rebind()). The first one fails with Conten-Length mismatch, expected x bytes, got 0. The second works OK and is obviously updating trgProgress.

I'm not sure what the right way to go about this is. Any suggestions?​

Eyup
Telerik team
 answered on 23 Jul 2015
1 answer
331 views

I would like to add two files into the radsciptmanager if the user is using a version of IE < 9.  My thought is that in the Page_Load I can test the users Browser and use an if statement to add in the 2 scripts. The reason being, these 2 files fix issues in IE 7&8 but they cause issues in IE 9&10. I have posted some code that I have tried out just not sure what I am missing or if it is possible. Is this possible with RadScriptManager? Thanks in advance.

 

 <telerik:RadScriptManager ID="RadScriptManager" runat="server" EnablePartialRendering="true"
            AsyncPostBackTimeout="1800" EnableCdn="true">
            <Scripts>
                <telerik:RadScriptReference Path="~/Scripts/​File1.js" />
                <telerik:RadScriptReference Path="~/Scripts/​File2.js" />
                <telerik:RadScriptReference Path="~/Scripts/File3.js" />
            </Scripts>
</telerik:RadScriptManager>

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

        if (type == "IE8" || type == "IE7")
        {
            RadScriptManager rsmgr = new RadScriptManager();
            //ScriptManager smgr = ScriptManager.GetCurrent(Page);
            ScriptReference SRef = new ScriptReference("~/Scripts/File4.js");
            ScriptReference SRef1 = new ScriptReference("~/Scripts/File5.js");

            rsmgr.Scripts.Add(SRef);
            rsmgr.Scripts.Add(SRef1);
        }​

Peter Filipov
Telerik team
 answered on 23 Jul 2015
11 answers
243 views
Hi,

I've been tasked with doing a timesheet application for the web and wanted to know if you had any spreadsheet controls for ASP.NET.  I noticed there was one for Silverlight, but I was hoping there was something for ASP.NET AJAX. 

Thanks.
Rumen
Telerik team
 answered on 23 Jul 2015
4 answers
216 views

I am working with Telerik RadCalendar Control. Page has Month and Year dropdowns and I am setting the RadCalendars FocusedDate from Month and Year dropdowns on a button click event. RadCalendar is not rendering the dates on the calendar. It displays only the navigation. Day cells are empty.  The button has to be clicked twice in order to see the properly rendered calendar.
Vasil
Telerik team
 answered on 23 Jul 2015
4 answers
820 views
Hi
I am using the RadWindowManager in a ASP.NET 4.0 and VS 2010. I placed a RadWindowMangaer on a content page. In the code behind of the button click I want to call this.radWindowManager1.RadAlert(...); For some reason after hitting the period after radWindowManger1 I do not see any of the pre build rad windows (radAlert, radconfirm etc). Maybe it is a version issue. I am using 2010.3.1215.40. Please help. All other controls in the suite work just fine.

<%

 

@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"

 

 

 

CodeBehind="Default.aspx.cs" Inherits="TelerikRadWindowSample._Default" %>

 

<%

 

@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

 

<

 

 

asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">

 

</

 

 

asp:Content>

 

<

 

 

asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">

 

 

 

<telerik:RadWindowManager ID="radWindowManager1" runat="server"></telerik:RadWindowManager>

 

 

 

<h2>

 

Welcome to ASP.NET!

 

 

</h2>

 

 

 

<asp:Button ID="Button1" runat="server" Text="Open Rad Window"

 

 

 

onclick="Button1_Click" />

 

 

 

</p>

 

</

 

 

asp:Content>

here is my code behind

 

protected

 

 

void Button1_Click(object sender, EventArgs e)

 

{

 

 

// I dont see RadAlert
this
.radWindowManager1.

 

}

 

 

Danail Vasilev
Telerik team
 answered on 23 Jul 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?