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;
}
<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> |
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(); |
} |
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
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?
This problem occurs after uploading the site
All controls are displayed in disarray
See photos
plz help me
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.