Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
376 views
Hi,

I'm new to Rad Controls, can any one please help me to resolve this issue

I have one RadGrid, in this I placed one gridtemplatecolumn which contains one panel. This panel contains two buttons and one label. I'm using this panel as popup.

My problem is when i click on fist button(Delete) the row should delete and when I click on link(Cancel) the panel should hide.
I'm not getting how to access this button and link in code behind.

this is my code..

<Code>
<telerik:GridTemplateColumn UniqueName="DeletePopup">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="PopupImgButton" CssClass="useredit" Text="Delete"
                                                runat="server" OnClientClick="this.disabled=true;__doPostBack(this.name,'');return false;" />
                                            <asp:Panel ID="PopUpPanel" runat="server" BackColor="White" BorderColor="Red" BorderStyle="Solid"
                                                BorderWidth="1px" Width="809px" Height="25px" CssClass="edit">
                                                <div>
                                                <asp:Button ID="Button1" runat="server" Text="Delete" CommandName="Deletebtn" OnClientClick="this.disabled=true;__doPostBack(this.name,'');" />
                                                    <asp:Label ID="Label1" runat="server"  Text="Are you sure you want to delete [John Smithfield]? This cannot by undone."></asp:Label>
                                                    <a href="#" class="NormalCloseLink" style="padding-left:300px;color:Blue">CANCEL</a>
                                                </div>
                                            </asp:Panel>
                                            <asp:PopupControlExtender ID="ImgPopupControlExtender" runat="server" TargetControlID="PopupImgButton"
                                                PopupControlID="PopUpPanel" Position="Top" OffsetX="-745" OffsetY="7">
                                            </asp:PopupControlExtender>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
 </Code>

please give me some solution for this...
Naresh
Top achievements
Rank 1
 answered on 14 Jun 2011
0 answers
230 views
i am having a similar problem, i am binding my radgrid to a datatable created manually after converting an xml to datatable, but update command doest give updated values,

here is my grid code

<telerik:RadGrid runat="server" ID="gvTable" AllowPaging="True" Skin="Vista" PageSize="100"
            AllowSorting="True" ClientSettings-DataBinding-EnableCaching="true" GridLines="None"
            AutoGenerateEditColumn="True" AutoGenerateDeleteColumn="True"
            AllowAutomaticUpdates="False" OnUpdateCommand="gvTable_UpdateCommand"
            OnInsertCommand="gvTable_InsertCommand"
             AllowAutomaticDeletes="True"
            AllowAutomaticInserts="True" onneeddatasource="gvTable_NeedDataSource">
            <ExportSettings FileName="Order Details" IgnorePaging="True" ExportOnlyData="true">
            </ExportSettings>
            <ClientSettings EnableRowHoverStyle="True" Selecting-AllowRowSelect="true">
                <DataBinding EnableCaching="True">
                </DataBinding>
                <Selecting AllowRowSelect="True"></Selecting>
            </ClientSettings>
            <MasterTableView InsertItemPageIndexAction="ShowItemOnCurrentPage" EnableHeaderContextMenu="True"
                CommandItemDisplay="Top" EditMode="InPlace" DataKeyNames="">
                <CommandItemSettings ShowExportToExcelButton="true" AddNewRecordText="" ShowAddNewRecordButton="False" />
                <Columns>
                </Columns>
                <HeaderStyle Font-Bold="False" />
            </MasterTableView>
            <PagerStyle Mode="NextPrevAndNumeric" />
        </telerik:RadGrid>

here is where i am assigning the datatable to grid on button click

        this.gvTable.DataSource = dataTable;
        Session["DataSource"] = dataTable;
        this.gvTable.MasterTableView.DataKeyNames = GetColNames(dataTable); // Gets the column names of the datatable and returns as string[]
        this.gvTable.DataBind();

here is the pageload event, its empty

protected void Page_Load(object sender, EventArgs e)
    {
}

here is the need datasource

protected void gvTable_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
    DataTable dt = this.GridSource;
    this.gvTable.DataSource = dt;
    this.gvTable.MasterTableView.DataKeyNames = GetColNames(dt);
}

here is the gvTable_UpdateCommand
protected void gvTable_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
    {
 
        GridEditableItem editedItem = e.Item as GridEditableItem;
        DataTable ordersTable = this.GridSource;
        //Locate the changed row in the DataSource
        DataRow[] changedRows = ordersTable.Select("col1 = " + editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["col1"].ToString());
        //editedItem["Item"].Controls[0]
        if (changedRows.Length != 1)
        {
            this.Label1.Text += "Unable to locate the Order for updating.";
            e.Canceled = true;
            return;
        }
        //Update new values
        Hashtable newValues = new Hashtable();
        e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);
        changedRows[0].BeginEdit();
        try
        {
            foreach (DictionaryEntry entry in newValues)
            {
                changedRows[0][(string)entry.Key] = entry.Value;
            }
            changedRows[0].EndEdit();
            Label1.Text = "Successfully updated";
        }
        catch (Exception ex)
        {
            changedRows[0].CancelEdit();
            Label1.Text += "Unable to update Orders. Reason: " + ex.Message;
            e.Canceled = true;
        }
    }

PROBLEM:
editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["col1"].ToString()
this line in the above function always gives old values, cant figure out why, please help, thanks


i have used the code from this page
http://www.telerik.com/help/aspnet-ajax/grid-updating-inplace-and-editforms.html
sohaib
Top achievements
Rank 1
 asked on 14 Jun 2011
2 answers
85 views
Hi friends

i am Srinivas

In my project i am using RadGrid. in my RadGrid i have a Asp label for Displaying a data form Backend tables. now i want to get the value from Asp label when i am click on RadDatePicker using Java Script.

I tried to get the Label Value in Java script like the Following Way but returns null value.

function dateselect(sender, args) {


        var rdgrid = $find("<%=RadGrid1.ClientID %>");
        var cell = sender.get_element().parentNode.parentNode;
        var index = cell.parentNode.rowIndex;
        var MasterTable = rdgrid.get_masterTableView();
        var row = MasterTable.get_dataItems()[index - 3]; //getting row
        var textbox = document.getElementById("lot_id");
        alert(textbox);
       

i want to get the label value in the current row.. 

Please help me

Thanks 

D.Srinivasa

D.SRINIVASA
Top achievements
Rank 2
 answered on 14 Jun 2011
6 answers
62 views
Hi !

I have the latest (Q1 2011) Version of Telerik WebUI.

When i create a Scheduler with Appointments, with very long subject Texts, i have this issue:

- I add an Background Color to each Appointment (Appointment.BackColor), because the appointments are delivered from an
existing windows based system, and need to be shown in Telerik with the same colors. If the subject text is very long, it will be line breaked, and outlined outside the appointmentment, directly in the radscheduer (see attached ScreenShot)

- As long as the Appointments have an CSS Style other than rsCategorySilver and no special backgroundcolor they are displayed correctly (Text is cutted before the end of the appointment)

Do you know, how to solve this issue ? I need many kind of different Background Colors.

with best regards
Markus



Ivan Zhekov
Telerik team
 answered on 14 Jun 2011
5 answers
114 views
I have a grid connected to an Access DB.  I am moving the website to a shared environment.  The new shared environment are virtual websites, so they are subfolders of another website on the server.  After I got the permissions set and the RestoreOriginalRenderDelegate set to false on the page, things aren't working.  The grid appears, but if I try to edit a record, the ajax progress bar appears, then goes away and nothing happens.  Any suggestions on what to look at?  I have no idea where to even start.  It all works perfectly on the original server.  If I can get some guidance, I can dig in to it and post code as necessary.
Iana Tsolova
Telerik team
 answered on 14 Jun 2011
5 answers
740 views

Hi All,

 

I'm using Telerik Grid and binded an XML through dataset. I've a autyo generate edit coulmn.

 When I press edit, I get a text box with exisitng value and update, cancel button. After typing new value whren i press am not getting the new value in the grid. Can any one help on this. I'm using updatecommand event,but no use so far. Here is my code

 

 Hashtable newValues = new Hashtable();
            ((GridEditableItem)e.Item).ExtractValues(newValues);

            GridEditableItem editItem = (GridEditableItem)e.Item;
            GridEditableItem editedItem = e.Item as GridEditableItem;
            GridEditManager editMan = editedItem.EditManager;

            var obj = editItem.GetDataKeyValue("ConnectionString");

            //TextBox txt = e.Item.FindControl("txtValue") as TextBox;
            //if (txt != null)
            //{
            //    string s = txt.Text;
            //}
            ds.Tables["add"].Rows[editItem.DataSetIndex][1] = "XXXXX";
            //radDisplay.DataSource = ds.Tables["add"];
            radDisplay.Rebind();
            StringWriter sw = new StringWriter();
            ds.WriteXml(sw);
            Session["decryptesXMLString"] = sw.ToString();

sohaib
Top achievements
Rank 1
 answered on 14 Jun 2011
1 answer
75 views
 
In GridButtonColumn on delete command ,
 I want to customise the popwindow as to change the title of the window & style of buttons.
I used the Code below but no idea for customization . Please find  the screen shot and have a look
<telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete"
     ButtonType="ImageButton" ImageUrl="~/Images/Delete.gif"
                 ConfirmText="Do you want to delete template?" ConfirmTitle="Delete Template" />

Thanks
Jaichand
Jayesh Goyani
Top achievements
Rank 2
 answered on 14 Jun 2011
5 answers
146 views
Whilst adding various RAD controls to my application I have come across quite a few cases where because I have altered default styling of certain HTML tags the RAD controls do not appear correctly. I would expect that the RAD controls would override the default styling in these cases.

Some examples of this are:

TD: Any padding or borders are not overriden in RAD Editor and the dialogs do not appear correctly.

LI: if a background image is applied many RAD controls do not look correct, eg. tree view, editor tool bar and dialogs.

To get around this I simply need to put various fixes in my CSS file, eg:

 

.RadComboBoxDropDown ul li, .rtsLI, .reEditorModes li, .rtLI, .rmItem, .rwControlButtons li
{
    background-image: none;
}
.RadWindow TD
{
    border: 0;
    padding:0;
}

But this is a nuisance to have to add these fixes everytime I notice an issue. I would expect that all RAD controls would override all CSS values and I think this should be fixed.

Bozhidar
Telerik team
 answered on 14 Jun 2011
1 answer
87 views
Hi,

I am using GridButtonColumn to delete a row from the RadGrid. It prompts the user as OK/Cancel. Is there any way to change that to Yes/No. 

TIA,
Uday M
Shinu
Top achievements
Rank 2
 answered on 14 Jun 2011
1 answer
236 views
HI,

I have a radGrid + TextBox + Button.

1. Now,  click to Button for search data.

2. If Textbox value is empty then Grid show all data correct and Event Grid PageIndexChanged is ok.

3. If Textbox value is not empty then Grid show "Condition data" correct.

4. When Textbox value is empty, i bind data to grid by click button search, grid show data correct. Now,  I change index page  grid (ex: page 3..) and enter value to textbox and click to button search --> RadGrid displays "No records to display" when the records exist.

I worked with RadGrid 2009 Q1 and bind data to Grid simple bind.!

Please help me  .!
Princy
Top achievements
Rank 2
 answered on 14 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?