How to add an editor on each row of a column tree - asp.net

I'm using Ext.NET 1.2. I need to create a ColumnTree in my system.
Markup
<ext:ColumnTree ID="colProjects" runat="server" RootVisible="false" Title="Projetos" EnableDD="true">
<TopBar>
<ext:Toolbar ID="Toolbar1" runat="server">
<Items>
<ext:Button ID="btnExpandAll" runat="server" Text="Expandir Tudo">
<Listeners>
<Click Handler="#{colProjects}.expandAll();" />
</Listeners>
</ext:Button>
<ext:Button ID="btnCollapseAll" runat="server" Text="Recolher Tudo">
<Listeners>
<Click Handler="#{colProjects}.collapseAll();" />
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<Loader>
<ext:TreeLoader>
<UIProviders>
<ext:TreeNodeUIProvider Alias="col" ClassName="<%# ColumnTree.ColumnNodeUI %>" AutoDataBind="true" />
</UIProviders>
</ext:TreeLoader>
</Loader>
<Columns>
<ext:ColumnTreeColumn Header="Nome" Width="330" DataIndex="Name" />
<ext:ColumnTreeColumn Header="Sistema" Width="100" DataIndex="ProjectGroup" />
<ext:ColumnTreeColumn Header="Recurso" Width="100" DataIndex="SprintOwner" />
<ext:ColumnTreeColumn Header="Status" Width="100" DataIndex="Status" />
</Columns>
</ext:ColumnTree>
I populate it dynamically via codebehind which works well. The last column needs to be editable and updated to the database but I have no idea whether or not it is possible to do so. How can I do that?

With 1.2 version of Ext.NET you can't do this.
Found at Ext.NET forum message from mcgill, author of Ext.NET.
http://forums.ext.net/showthread.php?12251-CLOSED-ColumnTree-cell-editing
At the moment Editors are not supported on the Component.
We did some preliminary investigation and will add this as a Feature
Request to implement in a future release.
There is a problem though... I think this functionality may be
included in the next major release of Ext.NET (v2). But that release
is a ways off yet.
As a solution I recommend you to look at this example: http://examples.ext.net/#/GridPanel/Data_with_Details/Form_Details/
You can do this in your project for grid and without unnecessary request to the server.

Related

Blazor WebAssembly Dev Express Data Grid - Load All Rows without Pagination

I started experimenting with devexpress Blazor Grid component for a project that we are migrating from Webforms to Blazor WebAssembly.
I see the pagination component in the grid works really fine.
But I have this requirement to load all records without pagination and kind of struggling to get the right settings
<DxDataGrid DataAsync="#GetEmployeeStatssAsync" WIDTH="700px" VerticalScrollBarMode="ScrollBarMode.Auto"
VerticalScrollableHeight="200">
<DxDataGridColumn Field="#nameof(EmployeeStatResponse.FullName)" Width="30px" />
<DxDataGridColumn Field="#nameof(EmployeeStatResponse.Batches)" Width="30px" />
<DxDataGridColumn Field="#nameof(EmployeeStatResponse.Lines)" Width="20px" />
<DxDataGridColumn Field="#nameof(EmployeeStatResponse.Units)" Width="20px" />
<DxDataGridColumn Field="#nameof(EmployeeStatResponse.Hours)" Width="30px" />
<DxDataGridColumn Field="#nameof(EmployeeStatResponse.LPH)" Width="30px" />
<DxDataGridColumn Field="#nameof(EmployeeStatResponse.Errors)" Width="30px" />
<DxDataGridColumn Field="#nameof(EmployeeStatResponse.EPer)" Width="30px" />
</DxDataGrid>
I tried by setting the pagesize as 10,000, But when I do that the screen freezes.
<DxDataGrid DataAsync="#GetEmployeeStatssAsync(51)" WIDTH="700px" PageSize="10000"
VerticalScrollBarMode="ScrollBarMode.Auto"
VerticalScrollableHeight="200">
Please let me know what is the correct wat to implement
Thank you in advance.
you can use the ShowPager, PagerAllDataRowsItemVisible, PageSize properties for DxDataGrid
<DxDataGrid Data="#employees" ShowPager="false" PagerAllDataRowsItemVisible="false" PageSize="10000">
<DxDataGridColumn Field="Id" AllowSort="false" Width="50px"/>
<DxDataGridColumn Field="Name" AllowSort="false" Width="50px"/>
<DxDataGridColumn Field="PhoneNumber" AllowSort="false" Width="50px"/>
</DxDataGrid>

telerik radmenu can't add radmenuitem

I'm working on a legacy webforms app. I've added a new radmenuitem to an existing radmenu (see link2 below) but I can't see it when I compile and run the page. The existing link, Link1, appears just fine. I can even change Link1 and see the changes when testing. Link2 doesn't show. I've tried forcing the page to update by making small changes to the code behind but that doesn't work.
<telerik:RadMenu ID="Menu1" runat="server">
<telerik:RadMenuItem Text="Links" Value="Links">
<Items>
<telerik:RadMenuItem Text="Link1" runat="server" Value="Link1" NavigateUrl="http://example.com">
</telerik:RadMenuItem>
<telerik:RadMenuItem Text="Link2" runat="server" Value="Link2" NavigateUrl="http://example.com">
</telerik:RadMenuItem>
</Items>
</telerik:RadMenuItem>
</telerik:RadMenu>
I'm using Visual Studio 2017. Asp.net webforms.
You need to add <Items> tag after RadMenu. Look into your final code.
<telerik:RadMenu ID="Menu1" runat="server">
<Items>
<telerik:RadMenuItem Text="Links" Value="Links">
<Items>
<telerik:RadMenuItem Text="Link1" runat="server" Value="Link1" NavigateUrl="http://example.com">
</telerik:RadMenuItem>
<telerik:RadMenuItem Text="Link2" runat="server" Value="Link2" NavigateUrl="http://example.com">
</telerik:RadMenuItem>
</Items>
</telerik:RadMenuItem>
</Items>
</telerik:RadMenu>
It turned out to be in the code. A custom security feature was hiding certain menu items using the VB.Net code below:
For Each mItem As RadMenuItem In Menu1.Items
If mItem.Value.ToUpper() <> "HELP" Then
mItem.Visible = False
End If
Next

AjaxControlToolkit PieChart not showing any data

I'm trying to implement a simple AjaxControlToolkit PieChart, but whatever data I'm using the page looks like this, on Chrome or IE 11 and IE 10:
Here is my simple code:
<asp:piechart id="PieChart1" runat="server" backcolor="#993333" bordercolor="#660033"
borderstyle="Solid" forecolor="White" height="349px" width="320px" charttitle="Country Population"
charttitlecolor="Blue">
<PieChartValues>
<asp:PieChartValue Category="India" Data="1000" PieChartValueColor="green" PieChartValueStrokeColor="white" />
<asp:PieChartValue Category="US" Data="3000" PieChartValueColor="blue" PieChartValueStrokeColor="black" />
<asp:PieChartValue Category="China" Data="6000" PieChartValueColor="pink" PieChartValueStrokeColor="red" />
<asp:PieChartValue Category="Australia" Data="7000" PieChartValueColor="yellow" PieChartValueStrokeColor="blue" />
</PieChartValues>
</asp:piechart>
Any help will be appreciated.
Thanks.

Ext.Net approach to desktop implementation

i wanto to start use a Ext.Net desktop (i use it as "normal page" for other application).
i want to know the best approach of initialization desktop from database data.
my actual approach is:
1. start with "minimal" desktop page (start menu ecc...) without any modules;
2. read data from database (based on same parameters) and create dynamic modules (i think with DesktopModuleProxy) whit userc control (ex i save path/title/etc... of usercontrol in database);
3. create usercontrol and render it in desktop
i start with this example: http://examples.ext.net/#/Desktop/Introduction/Overview/
method AddNewModule() works only if there is a submit (ex with a launcher), but it doesn't works from Page_Load event and i have this javascript error:
"Cannot read property 'length' of undefined" in ext.axd:93
maybe i use wrong lifecycle page?
finally maybe i use a webform instead usercontrol, but i have same case where i must use usercontrol...
thanks!
.aspx FILE
<ext:Desktop ID="Desktop1" runat="server">
<StartMenu Title="Ext.Net Desktop" Icon="Application" Height="300">
<ToolConfig>
<ext:Toolbar ID="Toolbar1" runat="server" Width="100">
<Items>
<ext:Button ID="Button1" runat="server" Text="Settings" Icon="Cog" />
<ext:Button ID="Button2" runat="server" Text="Logout" Icon="Key">
<DirectEvents>
<Click OnEvent="Logout_Click">
<EventMask ShowMask="true" Msg="Ciao..." MinDelay="1000" />
</Click>
</DirectEvents>
</ext:Button>
</Items>
</ext:Toolbar>
</ToolConfig>
</StartMenu>
<TaskBar TrayWidth="100">
<QuickStart>
<ext:Toolbar ID="Toolbar2" runat="server">
<Items>
<ext:Button ID="Button3" runat="server" Handler="tile" Icon="ApplicationTileVertical">
<QTipCfg Text="Tile windows" />
</ext:Button>
<ext:Button ID="Button4" runat="server" Handler="cascade" Icon="ApplicationCascade">
<QTipCfg Text="Cascade windows" />
</ext:Button>
</Items>
</ext:Toolbar>
</QuickStart>
<Tray>
<ext:Toolbar ID="Toolbar3" runat="server">
<Items>
<ext:ToolbarFill ID="ToolbarFill1" runat="server" />
</Items>
</ext:Toolbar>
</Tray>
</TaskBar>
<DirectEvents>
<Ready OnEvent="loadTest"></Ready>
</DirectEvents>
</ext:Desktop>
.cs file
[DirectMethod]
public void loadTest(object sender, DirectEventArgs e)
{
DesktopModuleProxy control = Ext.Net.Utilities.ControlUtils.FindControl<Ext.Net.DesktopModuleProxy> (this.LoadControl("/user/default.ascx"));
control.RegisterModule();
}
Error by chrome:
Uncaught TypeError: Cannot read property 'app' of undefined Default.aspx:31
Uncaught TypeError: Cannot read property 'length' of undefined ext.axd:93
these is a "last version" of my various tests. if i invoke same method "loadTest" by button (like the original example) it works. User control has only 1 label with datetime.
thanks!
You can use Ext.onReady and ext:ResourcePlaceHolder with DirectMethod on server, like this:
<ext:ResourcePlaceHolder runat="server" Mode="Script" />
<script type="text/javascript">
Ext.onReady(function () {
App.direct.YourDirectMethod();
});
</script>

How to use combobox in devexpress aspxgridview

I am displaying my data in a devexpress gridview. One of the column is state value. When the grid is edited, I have to show the state in a combobox, so that the user could change the state by choosing a different state. Currently it is displayed in a textbox, since it is the default. Essentially when the user clicks the edit button, a combobox should be displayed as part of the edit controls, and the combobox should be populated with all possible states in the codebehind and the selected value should be the initial value on the grid. It is very easy do it in MS gridview. But I couldn't see any sample code for how to do it in the devexpress gridview.
Thanks
Use GridViewDataComboBoxColumn. Declare datasource and attach it to combo box column or populate it in code behind. This example contains both variants.
You can also take a look at DevExpress grid editing demos.
<dx:GridViewDataTextColumn FieldName="FieldName" VisibleIndex="4">
<EditItemTemplate>
<dx:ASPxComboBox ID="ASPxComboBox1" runat="server" DataSourceID="newDataSource" >
</dx:ASPxComboBox>
</EditItemTemplate>
</dx:GridViewDataTextColumn>
You'll need to set the datasource so you'll get the list of values
If you don't have a data source and want to include the combo box items in your code, here's another way to create the column:
<dx:GridViewDataComboBoxColumn FieldName="QAAproval" VisibleIndex="11" Width="30px">
<PropertiesComboBox>`enter code here`
<Items>
<dx:ListEditItem Text="GENERIC" Value="GENERIC" />
<dx:ListEditItem Text="FAIR" Value="FAIR" />
<dx:ListEditItem Text="VSE" Value="VSE" />
<dx:ListEditItem Text="ECAV" Value="ECAV" />
<dx:ListEditItem Text="FMMDS" Value="FMMDS" />
<dx:ListEditItem Text="CLEAR" Value="CLEAR" />
</Items>
</PropertiesComboBox>
<CellStyle Font-Size="XX-Small">
</CellStyle>
</dx:GridViewDataComboBoxColumn>
Edit the GridView Template, and in the EditTemplate of the field, add the dropdownbox. It might come to look like this
<dx:GridViewDataTextColumn Caption="Field Name"
FieldName="FieldName" VisibleIndex="3">
<EditItemTemplate>
<cc1:DropDownList ID="DropDownList1" runat="server">
</cc1:DropDownList>
</EditItemTemplate>
</dx:GridViewDataTextColumn>
So when you edit that row, it will show the DDL
I have used the following code to have combo box in the aspxgridview.
I hope this example helps :
<dx:GridViewDataComboBoxColumn FieldName="DatabaseFieldName" Settings-FilterMode="DisplayText"
Width="3%" VisibleIndex="3" Visible="True" Caption="Priority" Settings-AutoFilterCondition="Contains"
HeaderStyle-VerticalAlign="Middle" HeaderStyle-HorizontalAlign="Center" CellStyle-HorizontalAlign="Center"
CellStyle-VerticalAlign="Top">
<PropertiesComboBox ValueType="System.String" DataSourceID="objDataSourceID"
Width="200px" Height="25px" TextField="TextFieldName" ValueField="ValueFieldName"
IncrementalFilteringMode="StartsWith">
</PropertiesComboBox>
</dx:GridViewDataComboBoxColumn>

Resources