Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
69 views
i'm going code a form for telerik rad grid to index of content for index works . i was selected item when i update and insert new record on one page. But when page.count >1 so result wrong. the item what i insert not seleted and not chage to current page. and i feel difficult to select item what item i just insert and update althrought i test many kind of example on demos but result wrong. Please help me!!!
source code as:

File ascx

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ManagerWorks.ascx.cs" Inherits="IPC_WORKS.UI.UserControl.ManagerWorks" %>

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

<style type="text/css">

    .style1

    {

        height: 122px;

        width: 118px;

    }

    .rgHeader

    {}

    .style3

    {

        height: 122px;

        width: 249px;

    }

    .style4

    {

        width: 98px;

    }

    .style6

    {

        width: 111px;

    }

    .style7

    {

        width: 118px;

    }

</style>

<center>

<table>

    <tr>

        <td valign = "top"><table width="100%" style="border-style">

    <tr>

        <td align ="right" class="style7"><asp:Label ID="Label12" runat="server" Text="Tên Công Việc"></asp:Label></td>

        <td class="style6"><asp:TextBox ID="txtWF_TittleName" runat="server" Width="330px" ErrorMessage="Nhập tên công việc"></asp:TextBox></td>

    </tr>

    <tr>

        <td align="right" class="style7"><asp:Label ID="Label11" runat="server" Text="Ngày Khởi Tạo"></asp:Label></td>

        <td class="style4"><telerik:RadDatePicker ID="RdpCreateDate" runat="server"

                Width="150px"></telerik:RadDatePicker></td>

    </tr>

     <tr>

        <td align="right" class="style7"><asp:Label ID="Label7" runat="server" Text="Ngày Bắt Đầu"></asp:Label></td>

        <td class="style6"><telerik:RadDatePicker ID="RdpStartDate" runat="server"

                Width="150px"></telerik:RadDatePicker></td>

    </tr>

    <tr>

        <td align="right" class="style7"><asp:Label ID="Label8" runat="server" Text="Ngày Kết Thúc"></asp:Label></td>

        <td class="style4"><telerik:RadDatePicker ID="RdpEndDate" runat="server" Width="150px">

        </telerik:RadDatePicker></td>

    </tr>

     <tr>

        <td align="right" class="style7"><asp:Label ID="Label5" runat="server"

                Text="Loại Công Việc" Width="113px"></asp:Label></td>

        <td align="left" class="style6">

            <telerik:RadComboBox ID="txtRadTypeCode" AllowCustomText="true"

                MarkFirstMatch="true" runat="server"

                DataTextField="Type_Name" Width="150px"

                DataValueField = "Type_Code" EmptyMessage="Loại công việc">

            </telerik:RadComboBox>

        </td>

    </tr>

      <tr>

        <td align="right" class="style7">

            <asp:Label ID="Label4" runat="server" Text="Mức Độ Khó" Width="99px"></asp:Label>

        </td>

        <td align="left" class="style6">

            <telerik:RadComboBox ID="txtRadLevelCode" AllowCustomText="true"

                MarkFirstMatch="true" runat="server" DataTextField="Level_Name" DataValueField="Level_Code"

                Width="150px" EmptyMessage="Mức độ khó">

            </telerik:RadComboBox>

        </td>

    </tr>

    <tr>

        <td class="style1" align="right">

            <asp:Label ID="Label3" runat="server" Text="Nội Dung Công Việc" ></asp:Label>

        </td>

        <td class="style3" colspan="3">

            <asp:TextBox ID="txtWF_Quote" runat="server" Height="200px"

                TextMode="MultiLine" Width="330px"></asp:TextBox>

        </td>

    </tr>

    <tr>

        <td colspan="4"></td>

    </tr>

    <tr>

        <td colspan="4" align="center">

            <asp:Button ID="btnNew" runat="server" Text = "Tạo Mới" Width="80px" onclick="btnNew_Click" />&nbsp;

            <asp:Button ID="btnOK" runat="server" Text="Cập Nhật" onclick="btnOK_Click" Width="80px"/>&nbsp;

            <asp:Button ID="btnDel" runat ="server" Text = "Xóa" Width="80px" onclick="btnDel_Click"/>&nbsp;

            <asp:Button ID="btnFile" runat ="server" Text ="Tải tài liệu" Width="80px"/>&nbsp;

            <asp:Button ID="btnGrantWorks" runat="server" Text="Giao Việc" Width="80px"/>

        </td>

    </tr>

</table></td>

        <td valign="top">

        <telerik:RadGrid ID="RadGrid_Works" AllowPaging="True" runat="server" OnItemCommand = "RadGrid_Works_ItemCommand"

            OnItemDataBound="RadGrid_Works_ItemDataBound" Width="800px" GridLines="None" 

                AutoGenerateColumns="False" GroupingEnabled="False" Skin="Outlook"

                Height="410px" onpageindexchanged="RadGrid_Works_PageIndexChanged">

        <PagerStyle Mode="NextPrev" />

        <MasterTableView TableLayout="Fixed" DataKeyNames="WF_Code" EditMode="InPlace" ClientDataKeyNames="WF_Code" PageSize="8" InsertItemPageIndexAction="ShowItemOnLastPage">

            <Columns>

                <telerik:GridTemplateColumn HeaderText="STT" DataField="WF_Code" HeaderStyle-Width="5%"  HeaderStyle-HorizontalAlign="Center">

                    <ItemTemplate>

                        <asp:Label ID="lblStt" runat="server" Text="" ></asp:Label>

                    </ItemTemplate>

                    <HeaderStyle HorizontalAlign="Center" Width="5%"></HeaderStyle>

                    <ItemStyle HorizontalAlign="Center" />

                </telerik:GridTemplateColumn>     

                <telerik:GridTemplateColumn UniqueName="WF_TitleName" DataField="WF_TitleName" SortExpression="WF_TitleName" HeaderText="Tên Công Việc " HeaderStyle-Width="20%" HeaderStyle-HorizontalAlign="Center">

                    <ItemTemplate>

                        <asp:Label ID="lblWF_TitleName" Height="36px" runat="server" Text='<%# Eval("WF_TitleName") %>'/>

                        <asp:TextBox ID="txtWF_TitleName" Height="36px" runat="server" Text='<%# Bind("WF_TitleName") %>' Width="20%" Style="display: none"/>

                    </ItemTemplate>

                    <HeaderStyle HorizontalAlign="Center" Width="20%"></HeaderStyle>

                    <ItemStyle HorizontalAlign="Left" />

                </telerik:GridTemplateColumn>

                <telerik:GridTemplateColumn UniqueName="WF_Quote" DataField="WF_Quote" SortExpression="WF_Quote" HeaderText="Nội Dung Công Việc" HeaderStyle-Width="25%" HeaderStyle-HorizontalAlign="Center">

                    <ItemTemplate>

                        <asp:Label ID="lblWF_Quote" runat="server" Height="36px" Text='<%# Eval("WF_Quote") %>'/>

                        <asp:TextBox ID="txtWF_Quote" runat="server" Height="36px" Text='<%# Bind("WF_Quote") %>' Width="20%" Style="display: none" />

                    </ItemTemplate>

                    <HeaderStyle HorizontalAlign="Center" Width="20%"></HeaderStyle>

                    <ItemStyle HorizontalAlign="Left" />

                </telerik:GridTemplateColumn>

                <telerik:GridTemplateColumn UniqueName="Emp_Code" DataField="Emp_Code" SortExpression="Emp_Code" HeaderText="Người Tạo" HeaderStyle-Width="10%" HeaderStyle-HorizontalAlign="Center">

                    <ItemTemplate>

                        <asp:Label ID="lblEmp_Code" Height="36px" runat="server" Text='<%# Eval("Emp_Code") %>'/>

                        <asp:TextBox ID="txtEmp_Code" Height="36px" runat="server" Text='<%# Bind("Emp_Code") %>' Width="10%" Style="display: none" />

                    </ItemTemplate>

                    <HeaderStyle HorizontalAlign="Center" Width="10%"></HeaderStyle>

                    <ItemStyle HorizontalAlign="Center" />

                </telerik:GridTemplateColumn>

                <telerik:GridTemplateColumn UniqueName="WF_StartDate" DataField="WF_StartDate" SortExpression="WF_StartDate" HeaderText="Ngày Bắt Đầu " HeaderStyle-Width="15%" HeaderStyle-HorizontalAlign="Center">

                    <ItemTemplate>

                        <asp:Label ID="lblWF_StartDate" runat="server" Text='<%# Eval("WF_StartDate","{0:d}") %>'/>

                        <asp:TextBox ID="txtWF_StartDate" runat="server" Text='<%# Bind("WF_StartDate","{0:d}") %>' Width="15%" Style="display: none" />

                    </ItemTemplate>

                    <HeaderStyle HorizontalAlign="Center" Width="15%"></HeaderStyle>

                    <ItemStyle HorizontalAlign="Center" />

                </telerik:GridTemplateColumn>

                <telerik:GridTemplateColumn UniqueName="WF_EndDate" DataField="WF_EndDate" SortExpression="WF_EndDate" HeaderText="Ngày Kết Thúc " HeaderStyle-Width="15%" HeaderStyle-HorizontalAlign="Center">

                    <ItemTemplate>

                        <asp:Label ID="lblWF_EndDate"  runat="server" Text='<%# Eval("WF_EndDate","{0:d}") %>'/>

                        <asp:TextBox ID="txtWF_EndDate" runat="server" Text='<%# Bind("WF_EndDate","{0:d}") %>' Width="15%" Style="display: none" />

                    </ItemTemplate>

                    <HeaderStyle HorizontalAlign="Center" Width="15%"></HeaderStyle>

                    <ItemStyle HorizontalAlign="Center" />

                </telerik:GridTemplateColumn>

                <telerik:GridTemplateColumn UniqueName="WF_Status" DataField="WF_Status" SortExpression="WF_Status" HeaderText="Trạng Thái" HeaderStyle-Width="15%" HeaderStyle-HorizontalAlign="Center">

                    <ItemTemplate>

                        <asp:Label ID="lblWF_Status" runat="server" Text='<%# Eval("WF_Status") %>'/>

                        <asp:TextBox ID="txtWF_Status" runat="server" Text='<%# Bind("WF_Status") %>' Width="15%" Style="display: none" />

                    </ItemTemplate>

                    <HeaderStyle HorizontalAlign="Center" Width="15%"></HeaderStyle>

                    <ItemStyle HorizontalAlign="Center" />

                </telerik:GridTemplateColumn>

            </Columns>

            <PagerStyle NextPageText="Trang sau" PrevPageText="Trang Trước" Mode="NumericPages" />

        </MasterTableView>

            <ClientSettings EnablePostBackOnRowClick="true" EnableRowHoverStyle="true" KeyboardNavigationSettings-AllowActiveRowCycle="true">

            <Selecting AllowRowSelect="True" />

            <KeyboardNavigationSettings AllowActiveRowCycle="True"></KeyboardNavigationSettings>

            </ClientSettings>

        </telerik:RadGrid>

       </td>

    </tr>

</table>

File .cs

using System;

using System.Collections;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Data.SqlClient;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.SessionState;

using System.Web.UI.WebControls;

using System.Web.UI.HtmlControls;

using System.Web.Caching;

using IPC.Bussiness;

using IPC.Utils;

using IPC.DataHelper;

using Telerik.Web.UI;

namespace IPC_WORKS.UI.UserControl

{

    public partial class ManagerWorks : System.Web.UI.UserControl

    {

        #region biến toàn cục

        protected string bkey;

        public bool iKey = false;

        public static int LastId = 0;//lastid

        protected decimal WF_Code

        {

            get { return Convert.ToDecimal(ViewState["WF_Code"]); }

            set { ViewState["WF_Code"] = value; }

        }

        #endregion

        #region khởi tạo dữ liệu

        protected void Page_Load(object sender, EventArgs e)

        {

            int startRow = (RadGrid_Works.CurrentPageIndex * RadGrid_Works.PageSize);

            LoadGrid("", 0);

            if (!Page.IsPostBack){

                LoadCombo();

                FillFirstData();

                try{RadGrid_Works.MasterTableView.Items[startRow].Selected = true;}

                catch (Exception){throw new Exception("Khong co so lieu");}

            }

        }

        #endregion

        #region xử lý dữ liệu form đăng ký công việc

        private void LoadGrid(string sSQLSearch, int iCheck)

        {

            BindData();

        }

        private void BindData()

        {

            DataTable dt = WorkController.Gets();

            if (dt != null)

            {

                RadGrid_Works.DataSource = dt;

                RadGrid_Works.DataBind();

                RadGrid_Works.AutoGenerateColumns = false;

                try{

                    for (int i = 0; i < RadGrid_Works.PageCount; i++){

                        if (iKey)

                        {

                            RadGrid_Works.Items[RadGrid_Works.Items.Count - 1].Selected = true;

                        }

                    }

                }

                catch { }

            }

        }

        /// <summary>

        /// insert if id = 0  or update if id!=0

        /// </summary>

        /// <param name="sender"></param>

        /// <param name="e"></param>

        protected void btnOK_Click(object sender, EventArgs e)

        {

            if (WF_Code == 0)

            {

                WorkController.InsertObj(GetObjectData());

                iKey = true;

            }

            else

            {

                WorkController.UpdateObj(GetObjectData());

                iKey = false;

            }

            ClearForm();

            WF_Code = 0;

            BindData();

        }

        private void ClearForm()

        {

            WF_Code = 0;

            txtWF_TittleName.Focus();

            txtWF_TittleName.Text = "";

            txtWF_Quote.Text = "";

            txtWF_Quote.Text = "";

            RdpCreateDate.SelectedDate = DateTime.Today;

            RdpEndDate.SelectedDate = DateTime.Today;

            RdpStartDate.SelectedDate = DateTime.Today;

            txtRadLevelCode.SelectedIndex = 0;

            txtRadTypeCode.SelectedIndex = 0;

        }

        private void LoadCombo()

        {

            txtRadTypeCode.DataSource = WF_Type_Controller.Gets();

            txtRadTypeCode.DataBind();

            txtRadLevelCode.DataSource = LevelController.Gets();

            txtRadLevelCode.DataBind();

        }

        private WF_WorksInfo GetObjectData()

        {

            WF_WorksInfo objWorks = new WF_WorksInfo();

            if(WF_Code != 0)

            {

                objWorks.WF_Code = WF_Code;

            }

            else{

                objWorks.WF_Code = CommonSQL.GetLatestID("tbl_WF_WORKS","WF_Code")+1;

               

            }

            objWorks.WF_TitleName = CommonLib.PreventSQLInjection(txtWF_TittleName.Text.ToString());

            if (RdpCreateDate.SelectedDate != null)

                objWorks.WF_CreateDate = Convert.ToDateTime(RdpCreateDate.SelectedDate);

            else

                objWorks.WF_CreateDate = DateTime.Today;

            if (RdpStartDate.SelectedDate != null)

                objWorks.WF_StartDate = Convert.ToDateTime(RdpStartDate.SelectedDate);

            else

                objWorks.WF_StartDate = DateTime.Today;

            if (RdpEndDate.SelectedDate != null)

                objWorks.WF_EndDate = Convert.ToDateTime(RdpEndDate.SelectedDate);

            else

                objWorks.WF_EndDate = DateTime.Today;

            objWorks.WF_Quote = CommonLib.PreventSQLInjection(txtWF_Quote.Text.ToString());

            if (txtRadLevelCode.SelectedValue != "")

            objWorks.LEVEL_Code = Convert.ToDecimal(txtRadLevelCode.SelectedValue);

            if (txtRadTypeCode.SelectedValue != "")

            objWorks.TYPE_Code = Convert.ToDecimal(txtRadTypeCode.SelectedValue);

            return objWorks;

        }

       

        protected void RadGrid_Works_ItemCommand(object source, GridCommandEventArgs e)

        {

            WF_WorksInfo objWork = new WF_WorksInfo();

            if (e.CommandName == "RowClick" && e.Item is GridDataItem){

                LastId = e.Item.ItemIndex;//LastId indexItem

                e.Item.Selected = true;

                WF_Code = Convert.ToDecimal(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["WF_Code"].ToString());

                FillObjControl();

            }

        }

        protected void RadGrid_Works_PageIndexChanged(object source, GridPageChangedEventArgs e)

        {

            RadGrid_Works.CurrentPageIndex = e.NewPageIndex;

            RadGrid_Works.DataBind();

        }

        protected void RadGrid_Works_ItemDataBound(object sender, GridItemEventArgs e)

        {

            int currentPageIndex = (RadGrid_Works.Items.Count/RadGrid_Works.PageSize);

            if(e.Item.ItemType != GridItemType.Header && e.Item.ItemType != GridItemType.Footer)

            {

                if (e.Item is GridDataItem)

                {

                    GridDataItem item = (GridDataItem)e.Item;

                    string id = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["WF_Code"].ToString();

                    if (id == WF_Code.ToString())

                        e.Item.Selected = true;

                    try

                    {

                        for (int i = 0; i < RadGrid_Works.PageCount; i++)

                        {

                            if (iKey)

                            {

                                RadGrid_Works.Items[RadGrid_Works.Items.Count - 1].Selected = true;

                            }

                            else

                                if (LastId != 0)

                                {

                                    RadGrid_Works.Items[LastId].Selected = true;

                                }

                        }

                    }

                    catch { }

                    for (int i = 0; i <= RadGrid_Works.PageCount; i++)

                    {

                        Label lbl = (Label)item.FindControl("lblStt");//accessing Label stt

                        if (null != lbl)

                        {

                            lbl.Text = Convert.ToString(e.Item.ItemIndex+ 1);

                        }

                    }

                }

            }

        }

        private void FillObjControl()

        {

            WF_WorksInfo objWork = WorkController.Get(Convert.ToDecimal(WF_Code));

            if (objWork != null)

            {

                txtWF_TittleName.Focus();

                txtWF_TittleName.Text = objWork.WF_TitleName;

                txtWF_Quote.Text = objWork.WF_Quote;

                RdpCreateDate.SelectedDate = objWork.WF_CreateDate;

                RdpStartDate.SelectedDate = objWork.WF_StartDate;

                RdpEndDate.SelectedDate = objWork.WF_EndDate;

                LevelInfo objLevel = LevelController.Get(Convert.ToDecimal(Session["Level_Code"]));

                if (objLevel != null)

                {

                    DataTable dtLevel;

                    txtRadLevelCode.SelectedValue = objWork.LEVEL_Code.ToString();

                    if (objLevel.Level_Name.ToString() == "")

                    {

                        dtLevel = LevelController.Gets();

                        txtRadLevelCode.DataTextField = "Level_Name";

                        txtRadLevelCode.DataValueField = "Level_Code";

                    }

                }

                WF_Type_Info objType = WF_Type_Controller.Get(Convert.ToDecimal(Session["TYPE_Code"]));

                if (objType != null)

                {

                    DataTable dtType;

                    txtRadTypeCode.SelectedValue = objWork.TYPE_Code.ToString();

                    if (objType.Type_Name.ToString() == "")

                    {

                        dtType = WF_Type_Controller.Gets();

                        txtRadTypeCode.DataTextField = "Type_Name";

                        txtRadTypeCode.DataValueField = "Type_Code";

                    }

                }

            }

        }

        protected void btnDel_Click(object sender, EventArgs e)

        {

            if (WF_Code != 0)

                WorkController.DeleteIndex(WF_Code);

            BindData();

        }

        private void FillFirstData()

        {

            DataTable dt = WorkController.GetTop1();

            if (dt != null)

            {

                WF_Code = decimal.Parse(dt.Rows[0][0].ToString());

                if (WF_Code != 0)

                    FillObjControl();

            }

        }

        protected void btnNew_Click(object sender, EventArgs e)

        {

            ClearForm();

        }

        #endregion

    }

}


Pavlina
Telerik team
 answered on 21 Apr 2011
1 answer
67 views
Is it possible to show a STANDARD tooltip on clickable rows in the grid.

Rows are clickable with

<ClientSettings>
<ClientEvents OnRowClick="RowClick"></ClientEvents>
</ClientSettings>

Thanks,
Marc
Mira
Telerik team
 answered on 21 Apr 2011
1 answer
139 views

Hi everyone,

I’ve to load a large amount of data in a RadGrid and in order to improve performance I would like to disable the RadGrid ViewState.

My RadGrid just show data and let the user to click in some image buttons to do some actions with the selected row.

When I set the EnableViewState to false, I’ve found the RadGrid1_ItemCommand event doesn’t fire when you click on the Image button but it does when you click on a link button.




<telerik:GridTemplateColumn FilterControlAltText="" UniqueName="TemplateColumn6">

<ItemTemplate>

<!--ImageButton doesn't fire the RadGrid1_ItemCommand event -->

<asp:ImageButton ID="ImageButton1" runat="server" CommandName="Imprimir2" ImageUrl="printer3.png"

CausesValidation="false" />

<!--LinkButton fires the RadGrid1_ItemCommand event-->

<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" CommandName="Imprimir"

Text="Print" CssClass="myCssStyle"></asp:LinkButton>

</ItemTemplate>

</telerik:GridTemplateColumn>


Best regards,
Martin
Telerik team
 answered on 21 Apr 2011
8 answers
473 views
Hi Telerik Team,
 
Is it possible to add header and footer in excel file while exporting from RadGrid?

Regards,
Zeeshan
Dhamodharan
Top achievements
Rank 1
 answered on 21 Apr 2011
1 answer
100 views

Hi,

I am trying to get either a RadToolTip working with a GridButtonColumn (because I need to use the RadWindow Confirm)

or

A Template column with a RadTooltip inside which also pops up a RadConfirm window.

I spent a good few hours yesterday and got this working....

<script type="text/javascript">
        function OnClientClicking(sender, args)
        {
            var callBackFunction = Function.createDelegate(sender, function (argument)
            {
                if (argument)
                {
                    this.click();
                }
            });
   
            var text = "Are you sure you want to archive this application?";
            radconfirm(text, callBackFunction, 300, 100, null, "Archive?");
            args.set_cancel(true);
        }
    </script>
 And then this on a RadButton in the Template Column
<telerik:RadButton ID="imgArchive" runat="server"  CommandName="Refs"  OnClientClicking="OnClientClicking"></telerik:RadButton>

The problem is that my usercontrols are loaded into a multipage using RenderSelectedPageOnly="true" and ajax.

When selecting the tab with the control used above I am getting 'OnClientClicking' is undefined.

All help appreciated.

Cheers,

Jon



Mira
Telerik team
 answered on 21 Apr 2011
1 answer
286 views
I am a little confused about integrating RadControls such as the RadTabStrip into SharePoint 2010. In the online help under the SharePoint 2010 integration it does not mention anything other than integrating the RadEditor, RadGrid, RadListView and RadScheduler. My question is one is it possible to use controls such as the RadTabStrip into SharePoint 2010 Page Layouts? And if so what are the steps I need to take to integrate the RadControls other than the RadEditor, RadGrid, RadListView and RadScheduler that seem to be in their own installer. Any help pointing me in the right direction would be greatly appreciated.

Thank you so much for your help with this.
Sebastian
Telerik team
 answered on 21 Apr 2011
1 answer
107 views
Hi,

I have a rad grid that is using EditFormSettings with a FormTemplate and in Popup mode.  It is displaying a couple of items in the popup for editing purposes that are not already displayed in the grid.  When a user is typing in information into these areas, I want to inform the user of any HTML tags they may mistakenly enter. 

As it stands now, in testing, when HTML tags are entered into one of the text boxes and save is clicked, the form just brings back what was on the screen  at submission and I record a HttpRequestValidationException in my event log.  Clicking on the cancel button also exhibits this behavior as it also performs a postback and will not let me cancel the edit without removing the offensive tags.

When I debug the page through Visual Studio, I get this error message from the ScriptResource.axd: "Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500".

I cannot turn off page validation.  Not an option.  What I need is some way to display a message to the user that the data they have entered is incorrect and that they need to correct it to continue.

Thanks.
Pavlina
Telerik team
 answered on 21 Apr 2011
5 answers
346 views
i am displaying data inside the telerik grid using sqldatasource which has a select command to join data from 2 tables

now, in that grid i want to have a button, when clicked will add the corresponding row to ANOTHER table alongwith data from a text box (textbox appearing inside the grid row where the button was clicked)

im stuck and need help



<telerik:RadGrid ID="radgridLukkheUsers" runat="server" DataSourceID="lukkheusers"
    GridLines="None" AutoGenerateColumns="False">
    <MasterTableView DataSourceID="lukkheusers">
        <Columns>
            <telerik:GridBoundColumn DataField="displayname" HeaderText="User" SortExpression="displayname"
                UniqueName="displayname">
            </telerik:GridBoundColumn>
             
            <telerik:GridButtonColumn ButtonType="PushButton" Text="Add" CommandName="Add">
            </telerik:GridButtonColumn>
              
        </Columns>
    </MasterTableView>
     
</telerik:RadGrid>
prashant kamdar
Top achievements
Rank 1
 answered on 21 Apr 2011
1 answer
34 views
Hello, 

I found I quit interesting stuff with the grid... let me explain you. :)
I have a grid, with the culture="fr-FR". In the same grid, I have a date.
When I filter this column, I right click on the header and I select "Filtrer" than "Plus petit que". Here, I select my date, let's say First of april : 01/04/2011 in french culture. After this I click "Filtrer" and every thing is working.

But, when I go back to this filter, the date have changed to 04/01/2011... Not the french culture...

I found this interesting :p


In the same post I have 2 questions...
Is it possible to arrive on 'Contains' when we want to filter?
Is it possible to press Enter to apply a filter?


Thanks a lot

Jean-Yves
Martin
Telerik team
 answered on 21 Apr 2011
1 answer
70 views
I'd like to broaden this question, but the forum doesn't allow me to change the title, so I'm putting up a new posting instead here:  http://www.telerik.com/community/forums/aspnet-ajax/grid/cleanest-way-to-bind-non-datatable-source-to-dropdownlist-in-code-behind.aspx


FYI, Below is my original question, which I'm still curious about, but what I really need to do is answer the broader question in the other post.

I have a couple of fields in my ViewModel that are integer representations of the Ids of a field whose name should be displayed to the user.  I would like to have a GridBoundColumn to represent them in my RadGrid's view mode, but for that to work, I need there to be an intermediary class that does a conversion from the integer underlying value to the text value the user needs to see.  Is there any provision for this with RadGrid, or if not, then what is the recommended practice for such a case?

Thanks!
Marin
Telerik team
 answered on 21 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?