or
| void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e) |
| { |
| if ((int)this.radGridView1.CurrentRow.Cells[2].Value < 10) |
| { |
| e.Cancel = true; |
| } |
| } |
void btnExportExcel_Click(object sender, EventArgs e){ this.SaveFileDialog.Filter = "Excel Workbook (*.xlsx) |*.xlsx|Excel 97-2003 Workbook (*.xls)|*.xls"; if (this.SaveFileDialog.ShowDialog() == DialogResult.OK) { ExportToExcelML exporter = new ExportToExcelML(this.dgResults); exporter.HiddenColumnOption = Telerik.WinControls.UI.Export.HiddenOption.DoNotExport; exporter.ExportVisualSettings = true; exporter.SheetName = this.GridTitle; if (Path.GetExtension(this.SaveFileDialog.FileName) == ".xls") { exporter.FileExtension = "xls"; exporter.SheetMaxRows = ExcelMaxRows._65536; } else { exporter.FileExtension = "xlsx"; exporter.SheetMaxRows = ExcelMaxRows._1048576; } try { this.lblReady.Text = "Exporting to Excel..."; this.StatusStrip.Refresh(); using (new UtilLib.Winforms.WaitCursor()) { exporter.RunExport(this.SaveFileDialog.FileName); } } catch (Exception ex) { UtilLib.Winforms.Feedback.DisplayError(ex); } finally { this.lblReady.Text = "Ready"; } }}| private RadWaitingBar waitingBar = new RadWaitingBar(); |
| private RadLabelElement _statusLabelElementCenter= new RadLabelElement(); |
| private RadLabelElement _statusLabelElementRight= new RadLabelElement(); |
| waitingBar.BeginInit(); |
| waitingBar.Size = new Size(200, 16); |
| waitingBar.MinimumSize = new Size(200, 16); |
| waitingBar.MaximumSize = new Size(200, 16); |
| waitingBar.EndInit(); |
| statusLabelElementCenter.AutoSize = true; |
| statusLabelElementCenter.Margin = new System.Windows.Forms.Padding(1); |
| statusLabelElementCenter.Text = "Here is some really long text that shows how the controls are overlapped."; |
| statusLabelElementRight.AutoSize = false; |
| statusLabelElementRight.Size = new Size(200, 16); |
| statusLabelElementRight.Margin = new System.Windows.Forms.Padding(1); |
| statusLabelElementRight.Text = "Right Label"; |
| //WaitingBar in RadHostItem, RadHostItem in PanelElement, based |
| //upon suggestions in previous post. |
| RadStatusBarPanelElement stripPanel = new RadStatusBarPanelElement(); |
| stripPanel.Size = new Size(200, 16); |
| stripPanel.Padding = new Padding(0); |
| stripPanel.Children.Add(new RadHostItem(waitingBar)); |
| radStatusStrip1.BeginInit(); |
| radStatusStrip1.Items.Add(stripPanel); |
| radStatusStrip1.Items.Add(statusLabelElementCenter); |
| radStatusStrip1.Items.Add(statusLabelElementRight); |
| radStatusStrip1.SetSpring(statusLabelElementCenter, true); |
| radStatusStrip1.EndInit(); |


Private Sub buttonSave_Click(ByVal sender As Object, ByVal e As EventArgs) Dim button As RadButton = TryCast(sender, RadButton) Me.BackstageControl.HidePopup() Me.SaveDocument(button.Tag.ToString())End Sub
