Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
186 views
Hi,
I am using Vista Skin for whole RadGrid and its working fine but now as per client requirement I have to change X image from GroupItems in GroupPanel. Instead of default image i have to choose a custom image. How to do it? I did some work around but as its taking Default skin i am not able to do anything.
#FYK : I want vista skin for rest of the grid.

Images are attached for better understanding (Current.jpg and I_Want.png)

Thanks.....
Rajneesh
Top achievements
Rank 2
 answered on 24 Aug 2011
1 answer
103 views
Hello,

Can i enter only one word in radtextbox?
Princy
Top achievements
Rank 2
 answered on 24 Aug 2011
5 answers
183 views
Hi,

I'm using the update feature of the grid. during the update, I use the

OnItemDataBoundHander(object sender, GridItemEventArgs e)

to prepopulate the RadComboBox as instructed within the examples. the following contains the C# code 

 

if (e.Item.IsInEditMode)  

GridEditableItem item = (GridEditableItem)e.Item;  

if (!(e.Item is IGridInsertItem))  

//this area is for update  

 

using (dl = new WellVentDataLayer())  

//For the Area section  

 

RadComboBox combo = (RadComboBox)item.FindControl("RadComboBoxArea");  

RadComboBoxItem selectedItem = new RadComboBoxItem(); 

selectedItem.Text = ((DataRowView)e.Item.DataItem)["AreaName"].ToString();  

combo.Items.Add(selectedItem);

selectedItem.DataBind();

}

}

}

and the following aspx code 

 

<telerik:GridTemplateColumn UniqueName="AreaName" HeaderText="Area" 

SortExpression="AreaName" ItemStyle-Width="150px" DataField="_AreaName"  

AndCurrentFilterFunction="Contains">  

 

<FooterTemplate

Template footer 

</FooterTemplate>  

 

<FooterStyle VerticalAlign="Middle" HorizontalAlign="Center" />  

 

<ItemTemplate

<%

#DataBinder.Eval(Container.DataItem, "_AreaName")%>  

</ItemTemplate>  

 

<EditItemTemplate>  

 

<telerik:RadComboBox runat="server" ID="RadComboBoxArea" EnableLoadOnDemand="True" DataTextField="AreaName" OnItemsRequested="RadComboBoxArea_ItemsRequested" DataValueField="ID" AutoPostBack="true" HighlightTemplatedItems="true" Height="140px" Width="100px" DropDownWidth="200px"  

 

OnSelectedIndexChanged="ComboBox1_OnSelectedIndexChangedHandler"> 

<ItemTemplate> 

<%# DataBinder.Eval(Container, "Text")%>  

</ItemTemplate>  

 

</telerik:RadComboBox>  

 

</EditItemTemplate>  

 

<HeaderStyle Width="100px" />  

 

<ItemStyle Width="100px"></ItemStyle>  

 

</telerik:GridTemplateColumn>

  

 

 

the code gave the following error on the row

Unable to cast object of type 'GHG_MCA.WellVentEvents' to type 'System.Data.DataRowView'.
 

selectedItem.Text = ((DataRowView)e.Item.DataItem)["AreaName"].ToString();  

 

thanks,
Minh Bui

Jayesh Goyani
Top achievements
Rank 2
 answered on 24 Aug 2011
2 answers
1.3K+ views
Is it possible to alter the time picker times?  I'd like to have it selectable in 15 minute intervals rather than 1 hour.

Ryan
Graham
Top achievements
Rank 1
 answered on 24 Aug 2011
1 answer
268 views
I have a grid with a column that is bound to a text field. This text is usually a number, but is sometimes a "-" character.

When exporting to Excel, I would like for the numbers to display with a single digit after the decimal point. So integers are displayed as #.0... (100.0 for example). I have the following style declaration:

Dim pctStyle As New Telerik.Web.UI.GridExcelBuilder.StyleElement("PctStyle")
pctStyle.AlignmentElement.HorizontalAlignment = GridExcelBuilder.HorizontalAlignmentType.Right
pctStyle.NumberFormat.FormatType = GridExcelBuilder.NumberFormatType.GeneralNumber
pctStyle.NumberFormat.Attributes("ss:Format") = "0.0"


It doesn't seem to work. The exported Excel file always shows 100 as 100, not 100.0.

I am wondering if this is because the underlying grid column data field is text? Is there any way to format the numeric output of a grid column that isn't bound to a numeric field?
Princy
Top achievements
Rank 2
 answered on 24 Aug 2011
1 answer
266 views
Hi,

I want to create a RadComboBox using javascript and add it to the div. Is it possible to create it dynamically at client site?
 
CODE
 if (columnName.toUpperCase() == "ORDER") {
                //Create ComboBox
                var radComboBox = new RadComboBox();
                radComboBox.id = "RadCBox" + ID;
                AddItemsToComboBox(radComboBox, orders);


               var divTag = document.getElementById("dynID");
               divTag.appendChild(radComboBox);
                
            }


Thanks,
Prava
Princy
Top achievements
Rank 2
 answered on 24 Aug 2011
1 answer
129 views
Is there any way to disable the SelectAll functionality of a SelectColumn checkbox in the header of a NESTED Table View.

GridHeaderItem item = RadGrid1.MasterTableView.GetItems(GridItemType.Header)[0] as GridHeaderItem;

does it for the main grid but how do I access the Header in the Details Table?

Jayesh Goyani
Top achievements
Rank 2
 answered on 23 Aug 2011
5 answers
177 views
Hello!

I've spent couple of hours trying to figure out how to delete, update or insert data into database via RadGrid. Could you point me out what I'm doing wrong. What I'd like to accomplish is to edit the data via EditForm, insert data via "Add New Record" Command and delete the data.

I've been going through Telerik's documentation, but I'm totally lost.

Codefront:
<telerik:RadGrid ID="gvKontakti" runat="server" AllowPaging="True" AllowSorting="True"
    AutoGenerateColumns="False"
    CellSpacing="0" GridLines="None"
    OnUpdateCommand="gvKontakti_UpdateCommand" Skin="Default"
    onDeletecommand="gvKontakti_DeleteCommand"
    oninsertcommand="gvKontakti_InsertCommand">
    <MasterTableView DataKeyNames="idKontakt" CommandItemDisplay="TopAndBottom">
        <Columns>
            <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
            </telerik:GridEditCommandColumn>
            <telerik:GridBoundColumn UniqueName="Kontakt" DataField="Naziv" HeaderText="Kontakt">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Funkcija" HeaderText="Funkcija" DataField="Funkcija">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Tel1" HeaderText="Telefon 1" DataField="Tel1">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Tel2" HeaderText="Telefon 2" DataField="Tel2">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Mob1" HeaderText="Mobitel 1" DataField="Mob1">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Mob2" HeaderText="Mobitel 2" DataField="Mob2">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Email1" HeaderText="E-mail 1" DataField="E-mail1">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Email2" HeaderText="E-mail 2" DataField="E-mail2">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Fax" HeaderText="Fax" DataField="Fax">
            </telerik:GridBoundColumn>
            <telerik:GridButtonColumn ConfirmText="Obrisati ovog korisnika?" ConfirmDialogType="RadWindow"
                    ConfirmTitle="Brisanje" ButtonType="ImageButton" CommandName="Delete" />
        </Columns>
        <EditFormSettings EditFormType="Template">
            <EditColumn UniqueName="EditColumn">
            </EditColumn>
            <FormTemplate>
                <table>
                    <tr>
                        <td>
                            Ime:
                        </td>
                        <td>
                            <asp:TextBox ID="txtIme" runat="server" Text='<%# Bind("Ime") %>'></asp:TextBox>
                        </td>
                        <td>
                            Prezime:
                        </td>
                        <td>
                            <asp:TextBox ID="txtPrezime" runat="server" Text='<%# Bind("Prezime") %>'></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Funkcija:
                        </td>
                        <td colspan="3">
                            <asp:TextBox ID="txtFunkcija" runat="server" Width="430px" Text='<%# Bind("Funkcija") %>'></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Telefon 1:
                        </td>
                        <td>
                            <asp:TextBox ID="txtTel1" runat="server" Text='<%# Bind("Tel1") %>'></asp:TextBox>
                        </td>
                        <td>
                            Telefon 2:
                        </td>
                        <td>
                            <asp:TextBox ID="txtTel2" runat="server" Text='<%# Bind("Tel2") %>'></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Mobitel 1:
                        </td>
                        <td>
                            <asp:TextBox ID="txtMob1" runat="server" Text='<%# Bind("Mob1") %>'></asp:TextBox>
                        </td>
                        <td>
                            Mobitel 2:
                        </td>
                        <td>
                            <asp:TextBox ID="txtMob2" runat="server" Text='<%# Bind("Mob2") %>'></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Fax:
                        </td>
                        <td>
                            <asp:TextBox ID="txtFax" runat="server" Text='<%# Bind("Fax") %>'></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            E-mail 1:
                        </td>
                        <td>
                            <asp:TextBox ID="txtEmail1" runat="server" Text='<%# Bind("Email1") %>'></asp:TextBox>
                        </td>
                        <td>
                            E-mail 2:
                        </td>
                        <td>
                            <asp:TextBox ID="txtEmail2" runat="server" Text='<%# Bind("Email2") %>'></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Adresa 1:
                        </td>
                        <td colspan="3">
                            <asp:TextBox ID="txtAdresa1" runat="server" Width="430px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Adresa 2:
                        </td>
                        <td colspan="3">
                            <asp:TextBox ID="txtAdresa2" runat="server" Width="430px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Adresa 3:
                        </td>
                        <td colspan="3">
                            <asp:TextBox ID="txtAdresa3" runat="server" Width="430px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Grad:
                        </td>
                        <td>
                            <asp:TextBox ID="txtGrad" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            PoÅ¡tanski broj:
                        </td>
                        <td>
                            <asp:TextBox ID="txtPBR" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Država:
                        </td>
                        <td>
                            <asp:TextBox ID="txtDrzava" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            BiljeÅ¡ke:
                        </td>
                        <td colspan="3">
                            <asp:TextBox ID="txtBiljeske" runat="server" Width="455px" Height="200px" TextMode="MultiLine"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Aktivan korisnik:
                        </td>
                        <td colspan="3">
                            <asp:CheckBox ID="chkAktivan" runat="server" Checked='<%# Bind("Aktivan") %>' />
                        </td>
                    </tr>
                </table>
                <asp:Button ID="btnUpdate" CommandName="Update" Text="Update" runat="server" />
                <asp:Button ID="btnDelete" CommandName="Delete" Text="Delete" runat="server" />
            </FormTemplate>
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>

Codebehind:

protected void Page_Load(object sender, EventArgs e)
{
    var kontakti = BindContacts();
    gvKontakti.DataSource = kontakti;
    gvKontakti.DataBind();
}
 
public object BindContacts()
{
    TSEntities db = new TSEntities();
    var kontakti = from k in db.Kontakts
                   select new { k.idKontakt, Naziv = k.Ime + " " + k.Prezime, Funkcija = k.Funkcija, k.Ime, k.Prezime, k.Tel1, k.Tel2, k.Mob1, k.Mob2, k.Email1, k.Email2, k.Fax, k.Aktivan };
 
    return kontakti;
}
 
protected void gvKontakti_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
    TSEntities db = new TSEntities();
 
    if (e.CommandName == RadGrid.UpdateCommandName)
    {
        if (e.Item is GridEditFormItem)
        {
            GridEditFormItem item = (GridEditFormItem)e.Item;
            int idKontakt = Convert.ToInt32(item.GetDataKeyValue("IdKontakt"));
 
            if (idKontakt > 0)
            {
                Kontakt kontakt = new Kontakt();
                kontakt = db.Kontakts.SingleOrDefault(k => k.idKontakt == idKontakt);
 
                TextBox txtIme = (TextBox)item.FindControl("txtIme");
                TextBox txtPrezime = (TextBox)item.FindControl("txtPrezime");
 
                kontakt.Ime = txtIme.Text;
                kontakt.Prezime = txtPrezime.Text;
                db.SaveChanges();
 
                gvKontakti.Rebind();
            }
        }
    }
}
 
protected void gvKontakti_DeleteCommand(object sender, GridCommandEventArgs e)
{
    TSEntities db = new TSEntities();
    Kontakt kontakt = new Kontakt();
 
    int idKontakt = (int)((GridDataItem)e.Item).GetDataKeyValue("IdKontakt");
 
    kontakt = db.Kontakts.SingleOrDefault(k => k.idKontakt == idKontakt);
 
    if (kontakt != null)
    {
        db.Kontakts.DeleteObject(kontakt);
        try
        {
            db.SaveChanges();
        }
        catch (System.Exception)
        {
             
        }
    }
 
}
 
protected void gvKontakti_InsertCommand(object sender, GridCommandEventArgs e)
{
    TSEntities db = new TSEntities();
}


Any help would be appreciated.

Elliott
Top achievements
Rank 2
 answered on 23 Aug 2011
2 answers
136 views
Hello,

I have a custom appointment with custom tooltips.  On the tooltip there is a rad button that when clicked updates the table that drives the scheduler.  When the button is clicked and the DB is updated i would like to have the schedule update the appointments at the same time.  I have been unable to accomplish this.  Can you point me in the right direction?

Thanks,

Michael.
Michael Constantine
Top achievements
Rank 1
 answered on 23 Aug 2011
2 answers
344 views
Hi,

I am using RAD DatePicker control from a licenced version of telerik cotnrols.
I had to allow the user to choose dates only after 14 days.hence I ahd set
txtdtcontrol.Mindate=Today.AddDays(14)

This should have applied only for choosing the dates.But it is considering this case for getting the date from the database and assigning it to the field also and this is the issue.

Please help solve this problem.How shall I set the calender popup to disable dates lesser than 14 days from now but does not affect for assigning the values to the selectedDate property of the control.

Is it possible to disable dates just on the popup and not to the textbox value as such.
Sachidananda
Top achievements
Rank 1
 answered on 23 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?