w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Refreshing Datagrid to the Parent page on click from the IFRAME page
If you just want to refresh Datagrid only , you may consider Ajax . Here is the link Or You may also consider a java script to refresh the grid, here is the code to give you an idea protected void grid_view_refesh() { grid_view.Bind(); } Button: <button id="btn_refresh" onclick="btn_refresh_click();">Refresh</button> javascript <script type="text/javascript" language="javascript"> function grid_view_refesh() { // you code to refresh grid } Hope it will help EDITED You can try this code on your popup windows ( Child window) <script type="text/javascript"> function CloseWindow() { window.close(); window.opener.location.reload(); } <input type="button" value="Close Window" onclick="javascript: return CloseWindow();" /&

Categories : C#

Rad Datagrid binds in page load but not in another function?
You need to have a Page.IsPostback in your Page_Load method. Otherwise data will be loaded every time you do anything that causes page to be reloaded. protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { using (ServiceReference1.Service1SoapClient myService = new ServiceReference1.Service1SoapClient()) { CurrentDemog = Convert.ToInt32(Session["demog"].ToString()); DataTable lookupTbl = myService.getTable(); LookupGrid.DataSource = lookupTbl; LookupGrid.DataBind(); } } } What happens here is that you load your grid view and click the button. When you do this Page_Load method is called before the event handler. This most probably ca

Categories : Asp Net

Pagination not showing current page in DataGrid
Could you post your code somewhere? I think at one point, we did have an issue with the styling of the datagrid - it definitely looks like the size of the select is incorrect, so it could be that it's not initializing correctly.

Categories : Twitter

Update component at change of page on primefaces datagrid with pagination
Finally, instead of <p:dataGrid ... /> i used <p:dataTable ... /> with <p:ajax ... /> inside, this is my code: <p:dataTable var="myVar" paginator="true" rows="1" value="#{myBean.listOfObjects}"> <p:ajax event="page" update="buttons" listener="#{myBean.update}" /> ... ... </p:dataTable> And update method: public void update(PageEvent event) { int var = event.getPage(); ... (update components values of dataTable and buttons using var) ... }

Categories : Ajax

DataGrid edition 'EditItem' is not allowed for this view` when bound to a WPF DataGrid
I tried this and the problem is that you have initialized your Level2 collection as Hashset<>. IEditableCollectionView.EditItem() throws this error while trying to update item in Hashset<>. I initialized the collection as List<> and it was working fine. I am not sure why it is not able to update item in hashset, need to look deeper into it. But changing the Hashset<> to List<> will fix this error. Hope it helps Thanks

Categories : C#

Silverlight Datagrid scrolling, DataGrid fires RowLoading event
The RowLoading event is fired because rows are virtualized. With virtualization, rows are created (and loaded) only when they are visible on screen. So every time you scroll down or up a new row is created, loaded and the RowLoading event fired. To disable the virtualization you can try to set this property: VirtualizingStackPanel.VirtualizationMode="Standard" Be aware that this can slow down the performance of your grid if you have a lot of rows.

Categories : Database

Binding ComboBoxColumn to collection from DataGrid's ItemsSource in WPF DataGrid
MSDN: DataGridComboboxColumns says: To populate the drop-down list, first set the ItemsSource property for the ComboBox by using one of the following options: A static resource. For more information, see StaticResource Markup Extension. An x:Static code entity. For more information, see x:Static Markup Extension. An inline collection of ComboBoxItem types. So basically to just bind to data object`s collection property it`s better to use DataGridTemplateColumn: <DataGridTemplateColumn Header="Log"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <ComboBox ItemsSource="{Binding log}" /> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> This type of c

Categories : Wpf

Validating A WPF Datagrid Against Data From Another Datagrid
From Microsoft official WPF course materials: ValidationRules are only to be used as simple validations (For instance Required fields, numeric formats, etc). If you need advanced / complex Business Rules validation, you should either implement IDataErrorInfo or create your own validation mechanism (that's what I did and it works like a charm)

Categories : C#

Copy selected row from datagrid at the end of datagrid
For Datagridview Databound you have to commit additional record to datasource (table) So, you have to do "INSERT INTO mytable ( fields here ... ) VALUES ( values here ..)" then to refresh your datagridview .. dt2.datasource = mytable ADDED : For your code ... try change like this insert_cmd.Parameters.AddWithValue("@Name", .item("Name")) insert_cmd.Parameters.AddWithValue("@Age", .item("Age"))

Categories : Sql Server

Master-Detail: On row click in master (DataGrid), display details (DataGrid)
If you searched online, you would have found a number of answers. For example, please take a look at the following articles: WPF Master Details MVVM Application Implementing a simple Master-Detail scenario for WPF in MVVM MVVM - Master Detail

Categories : Wpf

Copying data from a datagrid view to a new form with a new datagrid view VB
"Error 1 Reference to a non-shared member requires an object reference." As this message says: You need a instance of form2 - object of type form2created with New sub, which you created inside of BTN_Next_Click. But local variable frm_PI_01 can be used only inside of that function. With name of class form2 you can used only Shared member or functions/subs MSDN Shared members in VB My opinion if you need transfer some information/variables from form to another then in your case(when you transfer data only once when creating form) use a parameters in form constructors. Add another parameter to you form3 constructor. For example reference of your datagridview(this is may be not good practice referenced controls to another form, better create some variable with needed data and reference th

Categories : Vb.Net

How can embed datagrid in datagrid
I don't think it's possible. You can indeed manually replace a cell with the HTML of another grid (your "child" grid), but Dojo maintains its data in a store. Your store won't be "aware" of any changes you make in the DOM nodes of your grid, and inserting a DataGrid in a store isn't possible either since the DataGrid maps its columns to properties of the data objects.

Categories : Database

How to add a new row in sql from datagrid and update sql row from same datagrid?
This article on codeproject does a nice (thorough) job of demonstrating what you are asking. It also comes with some demo code. http://www.codeproject.com/Articles/37430/Datagrid-Editing-Updating-Cancel-Selecting-Rows

Categories : SQL

Binding datagrid in datagrid
You have problem with DataContext here. In RowDetailsTemplate you trying to binding to a property in main view model, but DataContext of RowDetailsTemplate is the row item. If you want to binding to property in your main view model you should use RelativeSource binding. Try this: <DataGrid ItemsSource="{Binding Path=Files}" SelectedItem="{Binding Path=DataContext.CurentFile, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" AutoGenerateColumns="False" > ...

Categories : Wpf

How to redirect /page/index page to /page (and /page to /page/) in Ruby on Rails?
If you don't want to cause a full reload of the page, then you should not use "redirect" in your routes, as that simply issues a browser redirect. That would cause Rails to issue a 301 "Moved Permanently". That essentially means "there is a /page/index route but it's a mistake, we don't use it anymore, please go to /page instead and never come back here." If that is the case then that is what you want to do. If you're using Passenger and will continue to use Passenger, it would be more efficient to put an Apache redirect rule in the htaccess file. It also seems strange that this is even an issue. How have /page/index, /page, and /page/ emerged in the wild as URLs that all point to the same index#index action? What is this index controller? The usual thing is to have, say, a PagesControlle

Categories : Ruby On Rails

JQuery Function not firing on page load it works only after i refresh page or re-visit the same page again
Well I got the general gist of your question but the entire question description is pretty confusing so I'll try to just help you out where I think it counts. var leftbar = $(".pg-left-bar").height(); var rightbar = $(".pg-right-bar").height(); if (leftbar >= rightbar) { $(".pg-right-bar").css({ "height": leftbar + "px" }) }else{ $(".pg-left-bar").css({ "height": rightbar + "px" }) } I omitted your magic numbers and the other code to make the change apparent but I think your issue was due to the lack of "px" being concatenated to the ends of your css declarations. If this isn't the issue would you mind showing a full example.

Categories : Javascript

With Flying Saucer, how do I generate a pdf with a page number and page total on every page at the footer?
In your html, you need to put this somewhere in the body tag: <div id="footer"> page <span id="pagenumber"></span> of <span id="pagecount"></span> </div> And this should be your css/style: #footer { position: running(footer); text-align: right; } @page { @bottom-right { content: element(footer); } } #pagenumber:before { content: counter(page); } #pagecount:before { content: counter(pages); } You can learn more about that @bottom-right option here.

Categories : Java

how can I pass a variable from an input box on one page to another page and use this info to perform a search on page 2?
Did you try and search for the answer first? This should help you... Link to your question that has already been answered

Categories : PHP

How can the Page Size, Page Orientation, and Page Margins of an ods Spreadsheet Be Set Using ODFDOM?
The necessary calls can be made to some of the underlying ODF objects which the SpreadsheetDocument provides access to. First, we need to get the proper document properties reference (for all examples, "spreadsheet" is a reference to a created SpreadsheetDocument): StyleMasterPageElement defaultPage = spreadsheet.getOfficeMasterStyles().getMasterPage("Default"); String pageLayoutName = defaultPage.getStylePageLayoutNameAttribute(); OdfStylePageLayout pageLayoutStyle = defaultPage.getAutomaticStyles().getPageLayout(pageLayoutName); PageLayoutProperties pageLayoutProps = PageLayoutProperties.getOrCreatePageLayoutProperties(pageLayoutStyle); Then, we can set the various properties, such as margins, orientation, and height/width. Note that the height and width values seem to

Categories : Java

how to display a coming soon page when a page doesn't have an index page using htaccess
I'm guessing that for http://domain1.com/, you've got the document root pointed to /domain1.com/, which means it will never be able to access files outside of the document root. You'll need to move the comingsoon.php file to the /domain1.com/ folder and include the same ErrorDocument. Another option is to include the full hostname in the original error document: ErrorDocument 403 http://maindomain.com/comingsoon.php But this will change the location in the browser's address bar.

Categories : Htaccess

Add, Edit DataGrid in WPF
if you have created a database or a list, u can retrieve data and print on the datagrid.. database db = new database (); //database employees emp = new employees (); //list or table in db var result1 = (from t in db.employees select t).ToList(); datagrid1.Itemssource=result1; it prints the data on datagrid

Categories : C#

WPF DataGrid and ITypedList
ICustomTypeDescriptor implementation is required for Row objects. http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/177aef94-62c5-438d-a4a9-8834390559ad

Categories : C#

Checkbox with DataGrid WPF
For an MVVM Solution you could try this: <StackPanel> <DataGrid ItemsSource="{Binding Path=TestItems}" AutoGenerateColumns="False" Name="MyDataGrid" CanUserAddRows="False"> <DataGrid.Columns> <DataGridCheckBoxColumn Binding="{Binding IsSelected}" Width="50" > <DataGridCheckBoxColumn.HeaderTemplate> <DataTemplate x:Name="dtAllChkBx"> <CheckBox Name="cbxAll" Content="All" IsChecked="{Binding Path=DataContext.AllSelected,RelativeSource={RelativeSource AncestorType=DataGrid}}"/> </DataTemplate> </DataGridCheckBoxColumn.HeaderTemplate> </DataGridCheckBoxColumn> <DataGridTe

Categories : Wpf

sorting a datagrid with GWT
Apparently my issue was with the fact that I had a keyProvider in both classes, instead of just one. I removed it from the OpInventory class and it seems to work now. this looks like a very specific issue so I expect this question will be closed soon. but I'll leave the code there for future analysis.

Categories : Java

Vi move through DataGrid
If I understand the issue correctly - you have a focus and selection per row. You want to move focus via k/j keys and to toggle selection via x key. I like to use behaviors in these situations - it requires reference to System.Windows.Interactivity.dll from blen SDK but it also makes for a cleaner and modular code. [edit: this is a quick POC that I did. It will probably require some more null reference protection and handling of fringe/edge cases] The behavior is: using System; using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Input; using System.Windows.Interactivity; namespace GridNavigationTest { public class GridNavigationBehavior : Behavior<DataGrid> { #region Overrides of Behavior ///

Categories : C#

How to have a DataGrid with two ButtonColumns in it?
Instead of OnSelectedIndexChanged="GradesDataGridSelectedCallback" Use OnItemCommand ="GradesDataGridSelectedCallback" And define your GradesDataGridSelectedCallback as Protected void GradesDataGridSelectedCallback(Object source , DataGridCommandEventArgs e) End Sub Checking e.CommandName would give you indication of which button is clicked.

Categories : C#

Triggers in datagrid
I'm not very experienced with DataGrid, so this might not be the best option, but I think you can achieve what you're after by styling the Row, rather than the individual Columns: <DataGrid <!-- Your settings here -->> <!-- Your column definitions here --> <DataGrid.RowStyle> <Style TargetType="DataGridRow"> <Style.Triggers> <DataTrigger Binding="{Binding Path=Errorcode}" Value="0"> <Setter Property="Background" Value="LightGreen" /> <!-- Other Setters --> </DataTrigger> <DataTrigger Binding="{Binding Path=Filename}" Value="File not created"> <

Categories : C#

Cannot set DataGrid row header value
You should use HeaderText property of Columns collection instead: dataGridView_replaceTable.Columns[0].HeaderText="ROW HEADER 1"; You could also do this when you add your columns by using Caption property: public void addCol() { DataColumn column; column = new DataColumn(string colName); column.DataType = System.Type.GetType("System.String"); column.ColumnName = colName; column.Caption = "My header" // ASSIGN HEADERS HERE column.ReadOnly = false; replaceTableValues.Columns.Add(column); }

Categories : C#

Opening PDF from a DataGrid
Process.Start("filename") will open a file using the default application on that machine. In most cases, the above approach is correct. It is not dependent on a particular application or particular version of the application being pre-installed on the target machine. The advantage is loose coupling between your application and the PDF viewer. If you really need to, you can use Process.Start() to launch a particular program, many of which will accept a filename as a command line parameter, like so: Process.Start("IExplore.exe", "C:myPathmyFile.htm") (This example taken from the linked MSDN documentation) You can find a list of Adobe Reader's command line arguments here: Adobe Reader Command Line Reference Update: The above link is old (focuses on version 7). You can find version 8 d

Categories : Vb.Net

Get hidden value from wpf datagrid
Rather than trying to read the value out of the Cell, why don't you just pull out the Databound item for your row? if (dgUserEnroll.SelectedItem != null) { var data = (User)dgUserEnroll.SelectedItem; var userID = data.UserId; }

Categories : C#

Can't refresh datagrid
If you see the old value with that type of data binding, it means you don't update the initial source, but only the temporary one (in your case t_KlantenViewSource). Calling Refresh method on the data added by FindResource cause app to reload it from pre-compiled resource, which won't change in this case. In other words, the problem is you use pre-compiled resource On the same time, you fill the dataset with actual data, but your dataset is in memory, view source - inside application file. You can try: binding ItemsSource of the entire datagrid or separate column to the TableAdapter dataset change resource compiling behaviour to Content, thus the app will reload it from external file each time you call Refresh method. ADDITION: You can find a solution for your case, just to save ti

Categories : C#

WPF MVVM DataGrid/Map
Use ObservableCollection for your data source but don't bind to that because that will bind to the default view of your collection, bind both controls to ICollectionView that you control so as you change your collection view in code both controls will update without the need to write any code to sync them... So in your case, when you filter the data, your view that is using TwoWay binding will change and since the map is bound to same view the changes in view will be immediately visible in the map as well...

Categories : Wpf

DataGrid Does not seem to allow editing
Ok, I just made an example that it is working. First I have my DataGrid definition: <asp:DataGrid ID="Grid" runat="server" DataKeyField="DatasetField1" AutoGenerateColumns="False" GridLines="None" OnCancelCommand="Grid_CancelCommand" OnEditCommand="Grid_EditCommand" OnUpdateCommand="Grid_UpdateCommand"> <Columns> <asp:BoundColumn HeaderText="Column1" DataField="DatasetField1"></asp:BoundColumn> <asp:BoundColumn HeaderText="Column2" DataField="DatasetField2"></asp:BoundColumn> <asp:EditCommandColumn EditText="Edit" CancelText="Cancel" UpdateText="Update" HeaderText="Edit"></asp:EditCommandColumn> </Columns> Second I must bind my data grid: public BindData() { .... Grid.DataSource = [MyDataSet With DatasetFi

Categories : C#

How can I solve datagrid showing in WPF?
Set the HorizontalScrollBarVisibility attribute of the datagrid to Visible or Auto and make sure each of your columns' Frozen attribute is set to false. Hope that works for you.

Categories : C#

EF WPF DataGrid Reload causes InvalidOperationException: why?
It seems to be an issue experienced when using proxies. It may be possible to resolve by disabling proxies, or possibly by not using change tracking (which is apparently discouraged now). As in my comments on the question there are others experiencing similar issues which can be found here: Stack Overflow Microsoft Connect

Categories : Wpf

ASP.NET DataGrid Dropdown Issue
Try this it will work protected void gv_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow && (e.Row.RowState & DataControlRowState.Edit) == DataControlRowState.Edit) { // Here you will get the Control you need like: DropDownList dl = (DropDownList)e.Row.FindControl("dvAllServices "); } }

Categories : C#

VB.NET- Is there any way to bind two datatable in a datagrid
a few options: option 1: load the data into one table instead of two option 2: merge the two datatables into one table, if they are all read-only option 3: use unbound columns - bind one table but unbound another table option 4: write a wrapper class to wrap the data and then bind the list (of the wrapper object) to the grid, something like: Public Class MyData Private _rowA As tblARow Private _rowB As tblBrow Sub New(rowFromA As tblARow, rowFromB As tblBRow) _rowA = rowFromA _rowB = rowFromB End Sub Property ColumnA As String Get Return _rowA.ColumnA End Get Set(value As String) _rowA.ColumnA = value End Set End Property ' // Other properties... End Class

Categories : Vb.Net

Data not displaying in datagrid
If you using ItemSource you have to generate an ItemTemplate. Binding WPF DataGrid to DataTable using TemplateColumns Using instead DataContext: SqlConnection thisConnection = new SqlConnection(@"Server=(local);Database=Sample_db;Trusted_Connection=Yes;"); thisConnection.Open(); string Get_Data = "SELECT * FROM emp"; SqlCommand cmd = thisConnection.CreateCommand(); cmd.CommandText = Get_Data; SqlDataAdapter sda = new SqlDataAdapter(cmd); DataTable dt = new DataTable("emp"); sda.Fill(dt); // Here: dataGrid1.DataContext = dt.DefaultView; DataContext is a general (dependency) property of all descendants of Frame

Categories : C#

new records to add first row of datagrid view in vb.net
You can use Insert instead of Add to specify the position for the new row. So always insert at position zero: DGVDeliverd.Rows.Insert(0, row1) See MSDN here for details (screenshot below).

Categories : Vb.Net

Bind List to DataGrid in WPF
Change this: public struct SomeInfo { public string Name; public string Description; public string ID; } to this: public class SomeInfo { public string Name {get;set;} public string Description {get;set;} public string ID {get;set;} } WPF does not support binding to fields. Only properties. And a struct is not an appropiate type for the data you're trying to represent.

Categories : Wpf



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.