If RadUpload1.UploadedFiles.Count > 0 Then
For Each validFile As UploadedFile In RadUpload1.UploadedFiles
MyNcr = validFile.GetName
If Right(validFile.GetName, 3) = "jpg" Or Right(validFile.GetName, 3) = "JPG" Then
'validFile.SaveAs(Path.Combine("c:\", validFile.GetName()), True)
Dim fs As FileStream = New FileStream(validFile.FileName, FileMode.Open, FileAccess.Read)
Dim br As BinaryReader = New BinaryReader(fs)
photo = br.ReadBytes(System.Convert.ToInt32(fs.Length))
br.Close()
fs.Close()
| <telerik:RadGrid ID="rgrdPayroll" runat="server" AutoGenerateColumns="False" DataSourceID="odsPersonnelByPI" |
| GridLines="None"> |
| <MasterTableView DataSourceID="odsPersonnelByPI" DataKeyNames="DisplayName" HierarchyLoadMode="ServerBind"> |
| <DetailTables> |
| <telerik:GridTableView runat="server" DataSourceID="odsPayrollByPI" GridLines="None"> |
| <ParentTableRelation> |
| <telerik:GridRelationFields DetailKeyField="DisplayName" MasterKeyField="DisplayName" /> |
| </ParentTableRelation> |
| <Columns> |
| <telerik:GridBoundColumn DataField="SlAcct6No" HeaderText="Account" UniqueName="SlAcct6No"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="AcctName" HeaderText="Account Name" UniqueName="AcctName"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Pay" DataType="System.Decimal" HeaderText="Pay" |
| ReadOnly="True" SortExpression="Pay" UniqueName="Pay" DataFormatString="{0:$#,#.#0;-$#,#.#0;$0.00}"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Benfit" DataType="System.Decimal" HeaderText="Benefit" |
| ReadOnly="True" SortExpression="Benfit" UniqueName="Benfit" DataFormatString="{0:$#,#.#0;-$#,#.#0;$0.00}"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Total" DataType="System.Decimal" HeaderText="Total" |
| ReadOnly="True" SortExpression="Total" UniqueName="Total" DataFormatString="{0:$#,#.#0;-$#,#.#0;$0.00}"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </telerik:GridTableView> |
| </DetailTables> |
| <ExpandCollapseColumn Visible="True"> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridBoundColumn DataField="DisplayName" HeaderText="Personnel" SortExpression="DisplayName" |
| UniqueName="DisplayName"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Total" DataType="System.Decimal" HeaderText="Total" |
| ReadOnly="True" SortExpression="Total" UniqueName="Total Salary" DataFormatString="{0:$#,#.#0;-$#,#.#0;$0.00}"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid> |
| protected void btnPDFPersonnel_Click(object sender, EventArgs e) |
| { |
| rgrdPayroll.ExportSettings.FileName = ddlPIs.SelectedValue.Substring(0, ddlPIs.SelectedValue.IndexOf(',')) + "_Personnel"; |
| rgrdPayroll.ExportSettings.OpenInNewWindow = true; |
| rgrdPayroll.ExportSettings.ExportOnlyData = true; |
| rgrdPayroll.ExportSettings.IgnorePaging = false; |
| rgrdPayroll.ExportSettings.Pdf.PageWidth = Unit.Parse("297mm"); |
| rgrdPayroll.ExportSettings.Pdf.PageHeight = Unit.Parse("216mm"); |
| foreach (GridItem item in rgrdPayroll.MasterTableView.Items) |
| { |
| item.Expanded = true; |
| } |
| rgrdPayroll.MasterTableView.ExportToPdf(); |
| } |
For a project I'm working on, we're looking for a way to dynamically add filters to a page which then control the dataoutput in a RadGrid. We want to add the filters dynamically because we want the customer to be able to change which properties can be filtered and what filtertype (textbox, dropdown, colourpicker, etc.) should be used.
The filter should work as follows:
The customer links a filter to a certain property and specifies the filtertype (for this example: dropdown). This is specified in a database table.
I have the following problems:
When I create the filters runtime, events are lost because the controls get recreated each postback.
Any help in one of the above would be great!
PS: One thing I thought about was passing along filter values in the postback which would have to be recognizable. That way the server could use them for selection and then create the filters and autoselect the previously selected filtervalues. I'm not quite sure how to acheive this though...
