Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
86 views
I need to get the value out of a hiddenfield of the item template on a client side click?  Any ideas?
Princy
Top achievements
Rank 2
 answered on 17 Feb 2011
1 answer
346 views
Hello,

I have a page with multiple user controls on it, inside a RadAjaxPanel.  I'm trying to figure out how I can use javascript to reload the user controls, which have data bound inside of them.  I just need a way to have them load as they would on initial load- how can I do this?
Tsvetina
Telerik team
 answered on 17 Feb 2011
3 answers
68 views
Hi,

I'm having a problem when I try to set some value on a field. I have a GridTemplateColumn with a RadComboBox, and if some value in specific is selected a windows shows up and return a value. If I'm on insert mode I can put this value on the field whit this code

protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
   GridDataItem item = (GridDataItem)combo.NamingContainer;
   HtmlInputText valor = (HtmlInputText)item.FindControl("Valor");
   valor.Value = e.Argument;
}

the combo variable is global and I obtain the value with this

protected void Op_OnSelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{   
   combo = (RadComboBox)sender;
}

this code works fine, but my problem comes when I try to update because doesn't change the value that the window returned.
I have this method
protected void ItemDataBound_condicion(object sender, GridItemEventArgs e)
{
     if (e.Item.IsInEditMode && e.Item is GridDataItem)
     {
        GridEditableItem item = e.Item as GridEditableItem;
        RadComboBox operador = (RadComboBox)item.FindControl("Operador");
        combo = operador;
        if (operador.SelectedValue == "En la lista" || operador.SelectedValue == "No en la lista")
        {
          valor = (HtmlInputText)item.FindControl("Valor");
          valor.Attributes.Add("onclick", "OnClientClick(valor.Value);
        }
    }
 }

I'm setting the combo to the RadComboBox of the row, and use the same code of the method RadAjaxManager1_AjaxRequest, but it doesn't work, only works when I change the value of  'Operador' but when I click the field 'Valor' doens't works.

Am I doing something wrong??

Thanks in advance.


Tsvetina
Telerik team
 answered on 17 Feb 2011
3 answers
101 views
I upgraded to the newest release of the ajax toolkit.  After the project is updated, I can't open the project anymore with visual studio 2010.  When opening, it hangs on "getting web.config" file.  If I delete the web.config file, it opens without a problem.  Has anybody else experienced this issue?
Lini
Telerik team
 answered on 17 Feb 2011
1 answer
170 views
Hi,

I am getting frequent warnings in my server which are related to radgrid... when i ran the app in my local its working fine. No errors nothing. Can anybody help me why  I am getting this warnings.... Here is my server warning message....


Log Name:      Application
Source:        ASP.NET 2.0.50727.0
Date:          2/11/2011 9:54:46 AM
Event ID:      1309
Task Category: Web Event
Level:         Warning
Keywords:      Classic
User:          N/A
Computer:      PACDCPCCOMA01.cable.comcast.com
Description:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 2/11/2011 9:54:46 AM
Event time (UTC): 2/11/2011 2:54:46 PM
Event ID: b60b4cc9c1c941a59414965489a83629
Event sequence: 79355
Event occurrence: 1
Event detail code: 0
  
Application information:
    Application domain: /LM/W3SVC/1/ROOT-1-129418968817826366
    Trust level: Full
    Application Virtual Path: /
    Application Path: C:\inetpub\wwwroot\OM\
    Machine name: PACDCPCCOMA01
  
Process information:
    Process ID: 3912
    Process name: w3wp.exe
    Account name: IIS APPPOOL\Classic .NET AppPool
  
Exception information:
    Exception type: NullReferenceException
    Exception message: Object reference not set to an instance of an object.
  
Request information:
    Request path: /EditWinAttachments.aspx
    User host address: 10.163.26.31
    User: CABLE\HAlmei001
    Is authenticated: True
    Authentication Type: Negotiate
    Thread account name: IIS APPPOOL\Classic .NET AppPool
  
Thread information:
    Thread ID: 4
    Thread account name: IIS APPPOOL\Classic .NET AppPool
    Is impersonating: False
    Stack trace:    at EditWinAttachments.gvAtt_ItemDataBound(Object sender, GridItemEventArgs e) in C:\Documents and Settings\bpucha1103c\Desktop\Latest code\CCOM_PROD\CellBackHaul\EditWinAttachments.aspx.cs:line 113
   at Telerik.Web.UI.RadGrid.OnItemDataBound(GridItemEventArgs e)
   at Telerik.Web.UI.GridItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows)
   at Telerik.Web.UI.GridItemBuilder.InitializeItem(Int32 dataSourceIndex, String& nextItemHierarchicalIndex, Boolean& itemIsInEditMode)
   at Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group)
   at Telerik.Web.UI.GridTableView.CreateItems(IEnumerator enumerator, GridColumn[] columns, ControlCollection controls)
   at Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource)
   at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource)
   at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data)
   at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data)
   at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
   at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
   at Telerik.Web.UI.GridTableView.PerformSelect()
   at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
   at Telerik.Web.UI.GridTableView.DataBind()
   at Telerik.Web.UI.RadGrid.DataBind()
   at EditWinAttachments.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\bpucha1103c\Desktop\Latest code\CCOM_PROD\CellBackHaul\EditWinAttachments.aspx.cs:line 39
   at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
   at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  
  
Custom event details:
 
Event Xml:
  <System>
    <Provider Name="ASP.NET 2.0.50727.0" />
    <EventID Qualifiers="32768">1309</EventID>
    <Level>3</Level>
    <Task>3</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2011-02-11T14:54:46.000000000Z" />
    <EventRecordID>9041</EventRecordID>
    <Channel>Application</Channel>
    <Computer>PACDCPCCOMA01.cable.comcast.com</Computer>
    <Security />
  </System>
  <EventData>
    <Data>3005</Data>
    <Data>An unhandled exception has occurred.</Data>
    <Data>2/11/2011 9:54:46 AM</Data>
    <Data>2/11/2011 2:54:46 PM</Data>
    <Data>b60b4cc9c1c941a59414965489a83629</Data>
    <Data>79355</Data>
    <Data>1</Data>
    <Data>0</Data>
    <Data>/LM/W3SVC/1/ROOT-1-129418968817826366</Data>
    <Data>Full</Data>
    <Data>/</Data>
    <Data>C:\inetpub\wwwroot\OM\</Data>
    <Data>PACDCPCCOMA01</Data>
    <Data>
    </Data>
    <Data>3912</Data>
    <Data>w3wp.exe</Data>
    <Data>IIS APPPOOL\Classic .NET AppPool</Data>
    <Data>NullReferenceException</Data>
    <Data>Object reference not set to an instance of an object.</Data>
    <Data>/EditWinAttachments.aspx</Data>
    <Data>10.163.26.31</Data>
    <Data>CABLE\HAlmei001</Data>
    <Data>True</Data>
    <Data>Negotiate</Data>
    <Data>IIS APPPOOL\Classic .NET AppPool</Data>
    <Data>4</Data>
    <Data>IIS APPPOOL\Classic .NET AppPool</Data>
    <Data>False</Data>
    <Data>   at EditWinAttachments.gvAtt_ItemDataBound(Object sender, GridItemEventArgs e) in C:\Documents and Settings\bpucha1103c\Desktop\Latest code\CCOM_PROD\CellBackHaul\EditWinAttachments.aspx.cs:line 113
   at Telerik.Web.UI.RadGrid.OnItemDataBound(GridItemEventArgs e)
   at Telerik.Web.UI.GridItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows)
   at Telerik.Web.UI.GridItemBuilder.InitializeItem(Int32 dataSourceIndex, String& nextItemHierarchicalIndex, Boolean& itemIsInEditMode)
   at Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group)
   at Telerik.Web.UI.GridTableView.CreateItems(IEnumerator enumerator, GridColumn[] columns, ControlCollection controls)
   at Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource)
   at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource)
   at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data)
   at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data)
   at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
   at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
   at Telerik.Web.UI.GridTableView.PerformSelect()
   at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
   at Telerik.Web.UI.GridTableView.DataBind()
   at Telerik.Web.UI.RadGrid.DataBind()
   at EditWinAttachments.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\bpucha1103c\Desktop\Latest code\CCOM_PROD\CellBackHaul\EditWinAttachments.aspx.cs:line 39
   at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
   at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
</Data>
  </EventData>
</Event>


code for EditWinAttachments.aspx

<telerik:RadGrid ID="gvAtt" OnItemCommand="gvAtt_ItemCommand" GridLines="None" AllowSorting="false"
                                        Width="98%" runat="server" AutoGenerateColumns="false" ShowFooter="false" ShowGroupPanel="false"
                                        ShowStatusBar="false" EnableEmbeddedSkins="false" HeaderStyle-HorizontalAlign="Left"
                                        ItemStyle-HorizontalAlign="Left" Font-Size="7.5pt" OnItemDataBound="gvAtt_ItemDataBound">
                                        <HeaderStyle BackColor="#004000" ForeColor="White" Font-Size="7.5pt" Font-Bold="True"
                                            HorizontalAlign="Left" BorderColor="White" />
                                        <AlternatingItemStyle BackColor="#F5F5E9" HorizontalAlign="Left" />
                                        <MasterTableView>
                                            <Columns>
                                                <telerik:GridBoundColumn ReadOnly="true" HeaderStyle-Width="180px" ItemStyle-Width="180px"
                                                    UniqueName="Type" HeaderText="Type" DataField="AttachmentType">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridTemplateColumn HeaderText="File Name" UniqueName="FileName">
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="lblAttBy" runat="server" Text='<%# Bind("AttachmentName") %>'
                                                            CommandName="AttaPath" ForeColor="Blue" CommandArgument='<%# Bind("AttachmentName") %>'></asp:LinkButton>
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridBoundColumn UniqueName="AttachmentLevel" DataField="AttachmentLevel"
                                                    HeaderStyle-Width="90px" ItemStyle-Width="90px" HeaderText="Level" ReadOnly="true">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridTemplateColumn HeaderStyle-Width="80px" ItemStyle-Width="80px" HeaderText="Attached By">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblCreatedBy" ToolTip='<%# Bind("username") %>' runat="server" Width="80px"
                                                            Text='<%# Bind("AttachedBy") %>'></asp:Label>
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridBoundColumn UniqueName="AttachedDate" HeaderStyle-Width="150px" ItemStyle-Width="150px"
                                                    HeaderText="Attached Date" DataField="AttachedDate" ReadOnly="true">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridTemplateColumn UniqueName="delete" ItemStyle-Width="15px" HeaderStyle-Width="15px">
                                                    <ItemTemplate>
                                                        <asp:ImageButton ID="lblDel" runat="server" ImageUrl="~/Images/Delete.png" CommandName="Delete"
                                                            ForeColor="Blue" OnClientClick="return delConfrm()" ToolTip="Delete attachment">
                                                        </asp:ImageButton>
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridBoundColumn ReadOnly="true" Visible="false" UniqueName="AttachmentPath"
                                                    DataField="AttachmentPath">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn ReadOnly="true" Visible="false" UniqueName="oaId" DataField="oaId">
                                                </telerik:GridBoundColumn>
                                            </Columns>
                                            <NoRecordsTemplate>
                                                No attachments are avaliable</NoRecordsTemplate>
                                        </MasterTableView>
                                        <ClientSettings>
                                            <Scrolling AllowScroll="True" UseStaticHeaders="True" ScrollHeight="220px" SaveScrollPosition="True">
                                            </Scrolling>
                                        </ClientSettings>
                                    </telerik:RadGrid>

public partial class EditWinAttachments : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString.Count > 0)
            {
                if (Request.QueryString[0].ToString() == "1")
                {
                    gvAtt.ClientSettings.Scrolling.ScrollHeight = Unit.Pixel(400);
                }
            }
            lblMsg.Text = "";
            if (Session["selorderID"] != null)
            {
                DBLayer obj = new DBLayer();
                SqlCommand cmd = new SqlCommand();
                SqlParameter param = new SqlParameter("@forderId", SqlDbType.NVarChar, 255);
                param.Value = Session["selorderID"].ToString();
                param.Direction = ParameterDirection.Input;
                cmd.Parameters.Add(param);
                DataSet dsGetAtt = obj.ExecuteDatasetSql("[usp_GetOrderAttachments]", cmd);
                gvAtt.DataSource = dsGetAtt;
                gvAtt.DataBind();
                //Session["RGAtt"] = dsGetAtt;
            }
 
            clsTaskUpdates_BL objBL = new clsTaskUpdates_BL();
            ddlAttCat.DataSource = objBL.getAttCate_BL();
            ddlAttCat.DataTextField = "Desc";
            ddlAttCat.DataValueField = "ID";
            ddlAttCat.DataBind();
            ListItem lst = new ListItem("Please Select", "0");
            ddlAttCat.Items.Insert(0, lst);
 
            ddlAttLvl.DataSource = objBL.getAttLvl_BL();
            ddlAttLvl.DataTextField = "Desc";
            ddlAttLvl.DataValueField = "ID";
            ddlAttLvl.DataBind();
            ListItem list = new ListItem("", "0");
            ddlAttLvl.Items.Insert(0, list);
            ddlAttLvl.Items.FindByText("ORDER").Selected = true;
        }
 
    }
 
    protected void gvAtt_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.CommandName == "AttaPath")
        {
            GridDataItem dataitem = e.Item as GridDataItem;
            string strPath = dataitem["AttachmentPath"].Text.Trim();
             
            System.IO.FileInfo targetFile = new System.IO.FileInfo(strPath);
            if (targetFile.Exists)
            {
                Response.Clear();
                Response.AddHeader("Content-Disposition", "attachment; filename=" + e.CommandArgument.ToString());
                Response.ContentType = "application/octet-stream";
                Response.WriteFile(targetFile.FullName);
                Response.Flush();
                Response.Close();
            }
            else
            {
                clsTaskUpdates_BL objBL = new clsTaskUpdates_BL();
 
                gvAtt.DataSource = objBL.getAttachments_Bl(Session["selorderID"].ToString());
                gvAtt.DataBind();
                ScriptManager.RegisterClientScriptBlock(this.upEditWinAddAtt, this.GetType(), "strSear", "alert('The requested attachment is moved/ deleted. Click [OK] to refresh attachments.')", true);
            }
        }
        else if (e.CommandName == "Delete")
        {
            GridDataItem dataitem = e.Item as GridDataItem;
            string strPath = dataitem["AttachmentPath"].Text.Trim();
 
            LinkButton lnkAttchName = (LinkButton)dataitem.FindControl("lblAttBy");
            string strAttachName = lnkAttchName.Text.Trim();
            string strAttchLevel = dataitem["AttachmentLevel"].Text.Trim();
 
            System.IO.FileInfo targetFile = new System.IO.FileInfo(strPath);
            if (targetFile.Exists)
                targetFile.Delete();
            clsTaskUpdates_BL objBL = new clsTaskUpdates_BL();
 
            gvAtt.DataSource = objBL.delAttachment_Bl(dataitem["oaId"].Text, Session["selorderID"].ToString(), strAttachName, strAttchLevel);
            gvAtt.DataBind();
        }
    }
 
    protected void gvAtt_ItemDataBound(object sender, GridItemEventArgs e)
    {
        try
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem dataItem = e.Item as GridDataItem;
                Label lblUser = (Label)dataItem.FindControl("lblCreatedBy");
                if (lblUser.Text.ToLower() != Session["UserName"].ToString().ToLower())
                {
                    ImageButton imgDel = (ImageButton)dataItem.FindControl("lblDel");
                    imgDel.Visible = false;
                }
            }
        }
        catch (Exception ex)
        {
 
        }
    }
 
    protected void btnSaveAtt_Click(object sender, EventArgs e)
    {
        try
        {
            lblMsg.Text = string.Empty;
            if (ddlAttLvl.SelectedItem.Value == "2" && Session["selProjectName"] == null)
            {
                //ClientScript.RegisterClientScriptBlock(this.GetType(), "cls1", "<script>ErrMsg()</script>");
                lblMsg.Text = "Project Name is NULL, attachments can not be assigned at PROJECT Level. Please use ORDER Level to add attachments";
            }
            else
            {
                lblMsg.Text = "";
                if (RadUpload1.UploadedFiles.Count > 0)
                {
                    UploadedFile file = RadUpload1.UploadedFiles[0];
                    string targetFileName = System.Configuration.ConfigurationManager.AppSettings["AttachmentPath"].ToString() + Session["selorderID"].ToString() + "-" + ddlAttCat.SelectedItem.Value + "-" + DateTime.Now.ToString("MMddyyyyhhmmss") + "-" + file.GetNameWithoutExtension() + file.GetExtension();
                    file.SaveAs(targetFileName);
                    clsTaskUpdates_BL objBL = new clsTaskUpdates_BL();
                    gvAtt.DataSource = objBL.setAttachments_Bl(Session["selorderID"].ToString(), ddlAttCat.SelectedItem.Value, file.GetName(), targetFileName, ddlAttLvl.SelectedItem.Text);
                    gvAtt.DataBind();
                    //ClientScript.RegisterClientScriptBlock(this.GetType(), "cls", "<script>parent.ref()</script>");
                }
                else
                {
                    lblMsg.Text = "* Please select a file to attach.";
                }
            }
        }
        catch (Exception ex)
        {
 
        }
    }
}
Pavel
Telerik team
 answered on 17 Feb 2011
1 answer
727 views
Hello,

For some reason, the RadTextBox is not re-enabling.  I initially disable it with this code:

notLinkingTextBox.set_value("");
notLinkingTextBox.set_enabled(false);

Later on, a process checks to see whether a radcombobox has a particular value, and enables or disables the textbox with:

if (sender.get_value() == "5") {
textbox.enable();
}
else {
textbox.set_value("");
textbox.disable();
}

I've also tried:

if (sender.get_value() == "5") {
textbox.set_enabled(true);
}
else {
textbox.set_value("");
textbox.set_enabled(false);
}

But none of these are bringing them back... so what is the way to reenable the textbox?  I verified it is hitting the enable code (enable() method or set_enabled(true) method), so what do I need to do?

Thanks.
Pavel
Telerik team
 answered on 17 Feb 2011
3 answers
394 views
Hi,

I am working on a project that have developed by previous developers. In this project, there is a RadGrid which is used to manage the members. The member details are fetched from the database using a stored procedure and is binding it to the RadGrid. When the number of members is large, it takes a very long time to load the grid. I have checked the code and found that the ItemDatabound event of the grid creates the problem. There are some checking in this event which required to load the values in the grid. The html part of the grid is :

 

<telerik:RadGrid ID="radGvMembers" runat="server" AllowPaging="True" AutoGenerateColumns="false"
                            GridLines="None" OnNeedDataSource="radGvMembers_NeedDataSource" AllowAutomaticDeletes="True"
                            AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowSorting="true"
                            AllowFilteringByColumn="True" OnUpdateCommand="radGvMembers_UpdateCommand" OnDeleteCommand="radGvMembers_DeleteCommand"
                            OnInsertCommand="radGvMembers_InsertCommand" OnItemCommand="radGvMembers_ItemCommand"
                            OnItemDataBound="radGvMembers_ItemDataBound" OnPreRender="radGvMembers_PreRender"
                            AllowMultiRowSelection="true" OnPageIndexChanged="radGvMembers_PageIndexChanged"
                            OnGridExporting="radGvMembers_GridExporting" Width="780px" OnSortCommand="radGvMembers_SortCommand">
                            <GroupingSettings CaseSensitive="false" />
                            <MasterTableView DataKeyNames="MemberId,IsBounced" CommandItemDisplay="Top" AllowCustomSorting="false"
                                Width="100%">
                                <ExpandCollapseColumn>
                                    <HeaderStyle Width="20px" />
                                </ExpandCollapseColumn>
                                <CommandItemTemplate>
                                    <div>
                                        <table width="100%">
                                            <tr>
                                                <td align="left">
                                                    <asp:LinkButton ID="linkAddButton" runat="server" CommandName="InitInsert">Add New Member</asp:LinkButton>
                                                </td>
                                                <td align="right">
                                                    <asp:LinkButton ID="linkRefresh" runat="server" CommandName="RebindGrid">Refresh</asp:LinkButton>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                </CommandItemTemplate>
                                <Columns>
                                    <telerik:GridClientSelectColumn DataType="System.Boolean">
                                    </telerik:GridClientSelectColumn>
                                    <telerik:GridEditCommandColumn ButtonType="ImageButton" DataType="System.Guid" UniqueName="EditColumn">
                                    </telerik:GridEditCommandColumn>
                                    <telerik:GridButtonColumn ButtonType="ImageButton" ConfirmDialogType="RadWindow"
                                        ConfirmText="Do you want to delete?" ConfirmTitle="Delete" Text="Delete" CommandArgument="MemberId"
                                        CommandName="Delete" UniqueName="DeleteColumn">
                                    </telerik:GridButtonColumn>
                                    <telerik:GridTemplateColumn UniqueName="ReinstateMember" AllowFiltering="false">
                                        <ItemTemplate>
                                            <asp:ImageButton ID="btnReinstateMember" runat="Server" CommandName="ReInstate" />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn UniqueName="Subscribe" AllowFiltering="false" HeaderText="IsSubscribed"
                                        SortExpression="IsSubscribed" DataField="IsSubscribed" DataType="System.Boolean">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="IsSubscribed" runat="server" Checked='<%#Eval("IsSubscribed")%>'
                                                Enabled="false" />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn DataField="IsBounced" SortExpression="IsBounced" AllowFiltering="false"
                                        UniqueName="BounceMember">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="btnBounceMember" runat="Server" CommandName="BounceMember" Text="Button" />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                </Columns>
                                <RowIndicatorColumn>
                                    <HeaderStyle Width="20px" />
                                </RowIndicatorColumn>
                                <EditFormSettings>
                                    <EditColumn UniqueName="EditCommandColumn1">
                                    </EditColumn>
                                </EditFormSettings>
                            </MasterTableView>
                            <FilterMenu EnableTheming="True">
                                <CollapseAnimation Duration="200" Type="OutQuint" />
                            </FilterMenu>
                            <ExportSettings ExportOnlyData="false" OpenInNewWindow="true" IgnorePaging="true">
                            </ExportSettings>
                            <ClientSettings AllowColumnHide="false">
                                <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling>
                                <Selecting AllowRowSelect="True" />
                            </ClientSettings>
                        </telerik:RadGrid>

and the code in the ItmeDataBound event is:

protected void radGvMembers_ItemDataBound(object sender, GridItemEventArgs e)
        {
            try
            {
                if (e.Item is GridDataItem)
                {
  
                    ImageButton btnReinstate = ((GridDataItem)e.Item).FindControl("btnReinstateMember") as ImageButton;
                    if (e.Item.Cells[6].Text == "True")
                    {
                        e.Item.Cells[1].Text = String.Empty;
                        e.Item.Cells[2].Text = String.Empty;
                        e.Item.Cells[4].Visible = false;
                        e.Item.Cells[6].Text = string.Empty;
                        e.Item.Cells[3].Enabled = false;
                        btnReinstate.ImageUrl = "~/App_Themes/Default/Grid/undo.jpg";
                        btnReinstate.OnClientClick = "return radconfirmWindow('Are you sure want to Re-Instate the Member'," +
                                                  "'" + btnReinstate.UniqueID + "','100','300','Member Management');";
                        (e.Item as GridDataItem).BackColor = System.Drawing.Color.Gray;
                    }
                    else
                    {
                        e.Item.Cells[6].Visible = false;
                        btnReinstate.Visible = false;
                    }
  
  
                    bool BouncedMemberStatus = Convert.ToBoolean(e.Item.OwnerTableView.DataKeyValues[e.Item.
                                        ItemIndex]["IsBounced"].ToString());
  
                    LinkButton btnBounced = ((GridDataItem)e.Item).FindControl("btnBounceMember") as LinkButton;
                    btnBounced.CommandArgument = BouncedMemberStatus.ToString();
                    btnBounced.Width = Unit.Pixel(80);
  
                    //Set Client Script
                    if (BouncedMemberStatus)
                    {
                        btnBounced.Text = "UnBounce";
                        btnBounced.OnClientClick = "return radconfirmWindow('Are you sure want to UnBounce the Member'," +
                                                   "'" + btnBounced.UniqueID + "','100','300','Bounce Management');";
                    }
                    else
                    {
                        btnBounced.Text = "Bounce";
                        btnBounced.OnClientClick = "return radconfirmWindow('Are you sure want to Bounce the Member'," +
                                                   "'" + btnBounced.UniqueID + "','100','300','Bounce Management');";
                    }
                }
                else if (e.Item is GridHeaderItem || e.Item is GridFilteringItem || e.Item is GridFooterItem)
                {
                    e.Item.Cells[6].Visible = false;
                    if (e.Item is GridHeaderItem)
                    {
                        CheckBox chk = ((GridHeaderItem)e.Item).FindControl("headerChkbox") as CheckBox;
                        if (chk != null)
                        {
                            chk.Checked = AreAllMembersSelected;
                        }
                    }
                }
            }
            catch (Exception Excep)
            {
                logger.Error("Error Trace on  " + System.Reflection.MethodBase.GetCurrentMethod().Name, Excep);
                Response.Redirect("~/ErrorPages/GenericErrorShow.aspx?msg=" + Excep.Message);
            }
        }

How can we speed up the execution of the page? Please advice me.

Manu
Top achievements
Rank 1
 answered on 17 Feb 2011
1 answer
105 views
I have a RadGrid set up for filtering.  I would like the page to postback (preferably via ajax) when a new filter is applied by the user.  I've searched through the documentation and there doesn't seem to be any sort of "OnFilterApplied" or "OnFilterApplying" event.  How can I accomplish this? 
Shinu
Top achievements
Rank 2
 answered on 17 Feb 2011
2 answers
391 views
Even with a script manager I'm still getting WebResource.axd requests for js files that include:
  • function WebForm_FindFirstFocusableChild(control)
  • function WebForm_PostBackOptions
Any idea how I can get those documents handled by the script manager?

Thanks!
msigman
Top achievements
Rank 2
 answered on 17 Feb 2011
2 answers
231 views
I have a radgrid using the automatic operations (insert/update/delete).  I have two columns in the grid called "ModifiedBy" and "DateCreated" When in edit mode and after the update button is clicked, I need to update the values of those columns for the selected item with the current logged in user and current date.  I know how to get the logged in user and date but I'm not clear on how to  bind that data back to the database.

How can this be done in the code-behind using vb.net?  I've tried to use e.Item.OwnerTableView.PerformUpdate() but I'm not sure how to do it.  Is there a better way to accomplish this?  Any help would be greatly appreciated.

 

Ryan Eaves
Top achievements
Rank 1
 answered on 17 Feb 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?