Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
507 views
Is it possible to change the RadTextbox's witdh by css ?

Please reply as soon as possible.
Rumen
Telerik team
 answered on 20 Nov 2019
3 answers
392 views

I have an on click event and I would like to bind to the Grid on click and make it view able.  My code is not working.  The grid is not made view able on button click.

 

My code:

. protected void btnFind_Click(object sender, EventArgs e)
        {
           
            strFind = txtFind.Text;
            AddFileNames(dataDir);
            

            foreach (var fileName in allFiles)
            {
                Document doc = new Document(fileName);
                Regex regex = new Regex(strFind, RegexOptions.IgnoreCase);
                FindReplaceOptions options = new FindReplaceOptions();
                doc.Range.Replace(regex, new ProcessFiles(), false);
                if (doc.HasRevisions == true)
                {
                    //string strFileName = System.IO.Path.GetFileName(fileName);
                    changedFiles.Add(fileName);
                    Session.Add("ChangeFilesList", changedFiles);
                    doc.Save(fileName);
                }

               
            }

            txtFind.Text = string.Empty;

            RadGrid1.DataSource = GetDocuments();


        }

 

private DataTable GetDocuments()
        {
            var dt = new DataTable();

           List<string> fileEntries = Session["allFilesList"] as List<string>;
            string[] files = fileEntries.ToArray();
            
            dt.Columns.Add("ID", typeof(Int32));
            dt.Columns.Add("DirectoryName", typeof(string));
            dt.Columns.Add("FileName", typeof(string));
            dt.Columns.Add("LastModifiedTime", typeof(DateTime));
            dt.Columns.Add("FilePath", typeof(string));
            dt.Columns.Add("BinaryData", typeof(byte[]));

            dt.PrimaryKey = new DataColumn[] { dt.Columns["ID"] };

            for (int i = 0; i < files.Length; i++)
            {
                var dr = dt.NewRow();

                dr["ID"] = i;

                var fileInfo = new FileInfo(fileEntries[i]);

                dr["DirectoryName"] = fileInfo.Directory.Name;
                dr["FileName"] = fileInfo.Name;
                dr["LastModifiedTime"] = fileInfo.LastWriteTime;
                dr["FilePath"] = fileEntries[i];
                dr["BinaryData"] = File.ReadAllBytes(fileEntries[i]);

                dt.Rows.Add(dr);
            }
            return dt;
        }

 

 

Attila Antal
Telerik team
 answered on 20 Nov 2019
1 answer
6.4K+ views
Hi,

I have rad grid. I want to hide the columns in a radgrid. How to hide it. This is my rad grid
<telerik:RadGrid ID="gvCktMap" AllowFilteringByColumn="True" OnNeedDataSource="gvCktMap_NeedDataSource" 
        AllowSorting="True" PageSize="15" AllowPaging="True" runat="server" GridLines="None" 
        ShowGroupPanel="True" EnableHeaderContextMenu="true" EnableHeaderContextFilterMenu="true" 
        EnableViewState="false" OnItemCreated="gvCktMap_ItemCreated"> 
        <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True"> 
            <ClientEvents OnRowDblClick="RowDblClick" /> 
            <Scrolling AllowScroll="true" UseStaticHeaders="true" /> 
            <Selecting AllowRowSelect="True"></Selecting> 
            <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True" 
                ResizeGridOnColumnResize="False"></Resizing> 
        </ClientSettings> 
        <GroupingSettings ShowUnGroupButton="true" /> 
        <PagerStyle Mode="NextPrevAndNumeric" HorizontalAlign="Right" Font-Bold="true" /> 
    </telerik:RadGrid> 

and this my codebehind.
    protected void Page_Load(object sender, EventArgs e) 
    { 
        try 
        { 
            winPopUps.InitiallyShown = false; 
            winFilter.InitiallyShown = false; 
            Response.AddHeader("Refresh", Convert.ToString((Session.Timeout * 60) + 5)); 
            if (Session.IsNewSession) 
            { 
                Response.Redirect("Default.aspx"); 
            } 
            if (!IsPostBack) 
            { 
                if (Session["TaskName"] != null) 
                    lblTaskName.Text = Session["TaskName"].ToString(); 
                Session["FilColms"] = null; 
                Session["SortExp"] = null; 
                Session["FilExp"] = null; 
                Session["ViewAll"] = null; 
                if (Session["TaskID"].ToString() == "206" || Session["TaskID"].ToString() == "209" || Session["TaskID"].ToString() == "208" || Session["TaskID"].ToString() == "207" || Session["TaskID"].ToString() == "210" || Session["TaskID"].ToString() == "400" || Session["TaskID"].ToString() == "401" || Session["TaskID"].ToString() == "402" || Session["TaskID"].ToString() == "403" || Session["TaskID"].ToString() == "404" || Session["TaskID"].ToString() == "216" || Session["TaskID"].ToString() == "215") 
                { 
                    lnkbtnComplete.Visible = false; 
                    if (Session["TaskID"].ToString() == "208") 
                    { 
                        lblBlkLbl1.Text = "Req SM Imp Date :"; 
                        lblBlkLbl2.Text = "CM Number :"; 
                        trBulkUpdates.Width = "63%"; 
                    } 
                    else if (Session["TaskID"].ToString() == "209") 
                    { 
                        lblBlkLbl1.Text = "Foc Date :"; 
                        lblBlkLbl2.Text = "Actual PTD :"; 
                        trBulkUpdates.Width = "67%"; 
                        txtBlkTxt3.Visible = true; 
                        lblBlkLbl3.Visible = true; 
                        lblBlkLbl3.Text = "Notificaiton Date :"; 
                        txtPackageSlip.Width = 100; 
                        valextFOCDt.Enabled = true; 
                        clnderFOCDt.Enabled = true; 
                        valFOCDt.Enabled = true; 
                    } 
                    else if (Session["TaskID"].ToString() == "215") 
                    { 
                        lblBlkLbl1.Text = "Gate3 Date :"; 
                        lblBlkLbl2.Text = "Gate2 Date :"; 
                        trBulkUpdates.Width = "73%"; 
                        txtBlkTxt3.Visible = true; 
                        lblBlkLbl3.Visible = true; 
                        lblBlkLbl3.Text = "Customer Accepted Date :"; 
                        txtPackageSlip.Width = 100; 
                        valextFOCDt.Enabled = true; 
                        clnderFOCDt.Enabled = true; 
                        valFOCDt.Enabled = true; 
                    } 
                    else if (Session["TaskID"].ToString() == "207") 
                    { 
                        lblBlkLbl1.Text = "CPE Ship Date :"; 
                        lblBlkLbl2.Text = "Package Slip :"; 
                        trBulkUpdates.Width = "58%"; 
                    } 
                    else if (Session["TaskID"].ToString() == "210" || Session["TaskID"].ToString() == "402") 
                    { 
                        lblBlkLbl1.Text = "Sch SM Imp Date :"; 
                        lblBlkLbl2.Text = "SM Number"; 
                        trBulkUpdates.Width = "63%"; 
                    } 
                    else if (Session["TaskID"].ToString() == "400") 
                    { 
                        lblBlkLbl1.Text = "PO Number :"; 
                        lblBlkLbl2.Text = "Req Number :"; 
                        ClndrPhyDt.Enabled = false; 
                        valPhyDt.Enabled = false; 
                        valCanlnder.Enabled = false; 
                        trBulkUpdates.Width = "60%"; 
                    } 
                    else if (Session["TaskID"].ToString() == "401") 
                    { 
                        lblBlkLbl1.Text = "NOC Acceptance Package Completion Date :"; 
                        lblBlkLbl2.Text = string.Empty; 
                        lblBlkLbl2.Visible = false; 
                        txtPackageSlip.Text = string.Empty; 
                        txtPackageSlip.Visible = false; 
                        trBulkUpdates.Width = "55%"; 
                    } 
                    else if (Session["TaskID"].ToString() == "403") 
                    { 
                        lblBlkLbl1.Text = "NOC Acceptance Date :"; 
                        lblBlkLbl2.Text = string.Empty; 
                        lblBlkLbl2.Visible = false; 
                        txtPackageSlip.Text = string.Empty; 
                        txtPackageSlip.Visible = false; 
                        trBulkUpdates.Width = "43%"; 
                    } 
                    else if (Session["TaskID"].ToString() == "404" || Session["TaskID"].ToString() == "216") 
                    { 
                        lblBlkLbl1.Text = "Billing Start Date :"; 
                        lblBlkLbl2.Text = "Saville Account Number :"; 
                        trBulkUpdates.Width = "70%"; 
                    } 
                    else if (Session["TaskID"].ToString() == "206") 
                    { 
                        lblBlkLbl1.Text = "Config Gen Date :"; 
                        lblBlkLbl2.Text = string.Empty; 
                        lblBlkLbl2.Visible = false; 
                        txtPackageSlip.Text = string.Empty; 
                        txtPackageSlip.Visible = false; 
                        trBulkUpdates.Width = "40%"; 
                    } 
                } 
            } 
            bingGrid(); 
 
        } 
        catch (Exception ex) 
        { 
        } 
    } 
 
 
 
 
    private void bingGrid() 
    { 
        try 
        { 
            gvCktMap.Columns.Clear(); 
            DataSet dsResult = new DataSet(); 
            DataSet dsEditItems = new DataSet(); 
            dsEditItems.ReadXml(Server.MapPath("XMLS/" + Session["TaskID"].ToString() + ".xml")); 
 
            clsSearch_BL clsObj = new clsSearch_BL(); 
            clsObj.TaskID = (string)Session["TaskID"]; 
            clsObj.CustName = (string)Session["CustName"]; 
            clsObj.MarketName = (string)Session["MarketName"]; 
            clsObj.HeadendName = (string)Session["HeadendName"]; 
            clsObj.SiteName = (string)Session["SiteName"]; 
            clsObj.TaskStatus = (string)Session["TaskStatus"]; 
            clsObj.OrdType = (string)Session["OrdType"]; 
            clsObj.OrdStatus = (string)Session["OrdStatus"]; 
            clsObj.ProName = (string)Session["ProName"]; 
            clsObj.LOC = (string)Session["LOC"]; 
 
            dsResult = clsObj.getSearchResults_BL(clsObj); 
            Session["SearchRes"] = dsResult; 
            DataTable dtFilter = new DataTable(); 
            DataColumn dtCol = new DataColumn("FilterBy"); 
            dtFilter.Columns.Add(dtCol); 
            dtCol = new DataColumn("DataType"); 
            dtFilter.Columns.Add(dtCol); 
            gvCktMap.DataSource = dsResult; 
} 
 
 
    protected void gvCktMap_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
    { 
        bingGrid(); 
    } 


i want to hide sid, customername and marketname columns before it displays to the user. I dont have any idea how to do that. Please help me.

Thanks
Eyup
Telerik team
 answered on 20 Nov 2019
1 answer
166 views
How I can use the custom command item template button to add a new row with the EditMode = InPlace. I found the answer for EditMode = Batch. But for InPlace mode, what's the javascript function I can add a new row in place? 
Eyup
Telerik team
 answered on 20 Nov 2019
4 answers
592 views

Have Radbutton on page displayed in Radwindow with OnClientClicking function:

 

function OnClientClicking(sender, args) {
                  document.getElementById('<%=form1.ClientID%>').style.cursor = 'wait';
                            }

The RadButton submits postback, but their is sometimes a delay.

The wait cursor displays when hovering on parts of the form that don't include controls (buttons, input controls)

Is there anyway to have the wait cursor show over the Radbutton as well, or all the controls would be better.

Thanks

John
Top achievements
Rank 1
 answered on 19 Nov 2019
1 answer
167 views

We are getting this inconsistency in the xml generated by the persistence framework, where by for some some instances the visible tag under PersistableColumnSetting is setting to false. 

            <PersistableColumnSetting>

              <UniqueName>PermitID</UniqueName>
              <Visible>false</Visible>
              <Display>false</Display>
              <SortExpression />
              <GroupByExpression />
              <OrderIndex>2</OrderIndex>
              <CurrentFilterFunction>NoFilter</CurrentFilterFunction>
              <CurrentFilterValue />
              <AndCurrentFilterFunction>NoFilter</AndCurrentFilterFunction>
              <AndCurrentFilterValue />
              <Width />
              <Aggregate>None</Aggregate>
            </PersistableColumnSetting>

 

and these seem to happen to columns that are with Display set to false, this is ruining the our grid because we need these column in OnItemDataBound and these columns become blank.

                        <telerik:GridBoundColumn DataType="System.Int32" ReadOnly="True" Display="False" Exportable="False" UniqueName="PermitID" DataField="PermitID">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="TenantID" DataType="System.Int32" Display="False" ReadOnly="True" Exportable="False" UniqueName="TenantID" />
                        <telerik:GridBoundColumn DataField="PermitGUID" DataType="System.Guid" UniqueName="PermitGUID" Display="False" Exportable="False" ReadOnly="True">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderStyle-Width="115px" FilterControlWidth="50px" FilterControlAltText="Filter Ref column" Aggregate="Count" FooterAggregateFormatString="{0} items" DataField="PermitRef" HeaderText="Permit Ref" SortExpression="PermitRef" UniqueName="PermitRef" ItemStyle-Font-Underline="true" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true"/>

 

We are finding it hard to debug because whenever we test, visible tag is always set to true, but some of our users are experiencing this. What triggers persistence framework to set visibility to false?

 

 

Vessy
Telerik team
 answered on 19 Nov 2019
0 answers
129 views

This problem occurs after uploading the site

All controls are displayed in disarray

See photos

plz help me

komeil
Top achievements
Rank 1
 asked on 19 Nov 2019
2 answers
185 views

Hello 

I am using RadGrid, which is using BatchEditing.

The grid has columns: From, To and Hours.

I am updating on Client column Hours as a difference of From and To: (From: 6:00 To: 10:30 Hours: 4:30).

This change needs to be done when the column is changed.

I am using the event "ClientSettings-ClientEvents-OnBatchEditCellValueChanged" to check if columns in question were changed and to prepare the result. However, I cannot use batchEditingManager.changeCellValue() in this event, because the event of changing the cell is not done yet. I will get an exception. I am currently waiting to user click and updating cells in that event, which is not optimal. I tried more events but with similar problems.

I know how to get cells, how to change them etc.

I just need the correct event after a cell is done updating or update function which will not loop to an existing event.

Thank you.

Igor
Top achievements
Rank 1
 answered on 19 Nov 2019
3 answers
226 views
I am trying to get a RadGrid to support both Virtualization and Custom Paging.  I can get either to work fine, but not both together.  This is my code for NeedDataSource below.  It seems that CurrentPageIndex  is always set to 0.  I would expect that to increment with the virtual scrolling.

  protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            
            int startRowIndex = RadGrid1.CurrentPageIndex * RadGrid1.PageSize;
            int maxRows = RadGrid1.PageSize;
            var reportDetails = DataAccess.GetReportDetails(Convert.ToInt32(reportSummary["ReportSummaryId"]), startRowIndex, maxRows);
            RadGrid1.DataSource = reportDetails;
        }

        protected void RadAjaxPanel_Init(object sender, EventArgs e)
        {
            //SET THE TOTAL # OF ROWS IN THE OVERALL REPORT
            string userKey = Common.GetUserKeyFromCookie(Request);
            DataTable reportSummaryTable = DataAccess.GetReportSummary(userKey, "SelectFollows");
            reportSummary = reportSummaryTable.Rows[0];
            int recordCount = Convert.ToInt32(reportSummary["RecordCount"]);
            RadGrid1.MasterTableView.VirtualItemCount = recordCount;
            RadGrid1.VirtualItemCount = recordCount;
        }



The code from my ASPX is:

<telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel" OnInit="RadAjaxPanel_Init" LoadingPanelID="RadAjaxLoadingPanel1">
        <telerik:RadGrid AutoGenerateColumns="False" ID="RadGrid1" PageSize="100" OnNeedDataSource="RadGrid1_NeedDataSource" runat="server">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <GroupingSettings CaseSensitive="false" />
            <MasterTableView AllowCustomPaging="true" AllowPaging="true" TableLayout="Fixed">
                <Columns>
                    <telerik:GridBoundColumn UniqueName="ScreenName" HeaderText="ScreenName" HeaderStyle-Width="250px" DataField="ScreenName"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="ProfileImage" HeaderText="Photo" HeaderStyle-Width="250px" DataField="ProfileImage"></telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings ReorderColumnsOnClient="true" AllowColumnsReorder="true" ColumnsReorderMethod="Reorder">
                <Virtualization EnableVirtualization="true" InitiallyCachedItemsCount="100"
                    LoadingPanelID="RadAjaxLoadingPanel1" ItemsPerView="100" />
                <Scrolling AllowScroll="true" EnableVirtualScrollPaging="true" UseStaticHeaders="true" ScrollHeight="500px" />
                <Resizing AllowColumnResize="true" />
            </ClientSettings>
            <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
        </telerik:RadGrid>

    </telerik:RadAjaxPanel>
Eyup
Telerik team
 answered on 19 Nov 2019
4 answers
156 views

Hello,

there is a bug with linear-gradient mixin. When no gradient is defined, invalid css is generated.

For example:

Upload.Bootstrap.scss

// ProgressBar
.ruFileProgressWrap {
    background-color: $progress-bg;
    background-image: linear-gradient($progress-gradient);
    border-radius: 2px;
}

results in

.RadUpload_Bootstrap .ruFileLI .ruFileProgressWrap {
  background-color: whitesmoke;
  background-image: linear-gradient();
  border-radius: 2px; }

So background-image value is invalid and should be "none"

.RadUpload_Bootstrap .ruFileLI .ruFileProgressWrap {
  background-color: whitesmoke;
  background-image: none;
  border-radius: 2px; }

 

This is problem in source files, Skin builder generates the same files etc. When this css is passed for some postprocessing in build process (postcss and autoprefixer for example), it fails.

 

Best Regards

René

René
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 18 Nov 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?