.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Binding execution order problem?

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :WPF


I'm developing DataGridTreeViewItem custom control which task is to display some icon and title. This control should be placed in TemplateColumn of wpf DataGrid.

Here is the code:

<wpfToolkit:DataGridTemplateColumn Header="Entire Network" Width="Auto" MinWidth="200">

View Complete Post

More Related Resource Links

wpf charting column series data binding problem

I'm trying to build a chart using the columnSeries from the wpf toolkit and I appear to be having trouble with the data binding. Here is the xaml: <Grid>    <chartingToolkit:ColumnSeries Height="18" HorizontalAlignment="Left" Margin="188,169,0,0" Name="columnSeries1" VerticalAlignment="Top" Width="18" IndependentValueBinding="{Binding Path=Date}" DependentValueBinding="{Binding Path=Value}" /></Grid> In the code behind, I'm calling a stored procedure and putting the result in a datatable like this: string connString = ConfigurationManager.ConnectionStrings["string"].ConnectionString;            using (SqlConnection cn = new SqlConnection(connString))            {                DataTable dt = new DataTable("T1");                cn.Open();                SqlCommand cmd = new SqlCommand("T1_sp", cn);                cmd.CommandType = CommandType.StoredProcedure;                  SqlDataAdapter da = new SqlDataAdapter(cmd);                da.Fill(dt);                columnSeries1.ItemsSource = dt.DefaultView;                cn.Close();            } No error is being generated but I'm not getting a column chart either. If I take the same command and put it into a datagrid, it works fine. What do I need to do to get this into my column chart? If it helps,

ajax combobox having problem in binding data

Hi i am using ajaxtoolkit:combobox and i tried to bind data to this control in code behind file. but it is taking 3 to 4 mints to bind data and display the page. what is the problem? I am providing my aspx code and code behind code here<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="TestPage.aspx.cs" Inherits="Dashboards_TestPage" Title="Untitled Page" %> <asp:Content ID="Content1" ContentPlaceHolderID="cphMain" Runat="Server"> <asp:ScriptManager runat="server" ID="scriptMgr"> </asp:ScriptManager> <table border="1"> <tr> <td> <ajaxToolkit:ComboBox ID="ddlProgram" runat="server" DropDownStyle="DropDownList" AutoCompleteMode="SuggestAppend" CaseSensitive="False" MaxLength="10"> </ajaxToolkit:ComboBox> </td> </tr> </table> </asp:Content>  Code behind code:public partial class Programs_TestPage : System.Web.UI.Page { ProgramData programData = new ProgramData(); protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack)

Problem Binding DropdownList in a gridView to a datasource

I have a Dropdownlist in an itemTemplate in a gridview. My gridView binds to dataTable1 (from which the selected value for dropdown comes from) and dropDown binds to dataTable2 (i need to get DataValueField and DataTextField from here).<asp:TemplateField HeaderText="Category"> <ItemTemplate> <asp:DropDownList ID="Cat" runat="server" SelectedValue='<%#Bind("CATEGORY") %>' > </asp:DropDownList> </ItemTemplate> <FooterStyle BorderStyle="None" /> <HeaderStyle BorderStyle="None" /> <ItemStyle BorderStyle="None" /> </asp:TemplateField>How do I do that? thanks in advance!

WCF protocol binding on htttp://* problem

Hello, has anyone found a solution to this famous Visual Studio 2008 problem with WCF debugging? It's in other threads of the forum, http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/782a48a2-a44c-4ced-934b-715c2e4cb6a4 http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/41630af1-37ec-411f-969b-3e857f978279/ but it's never really been answered. I have been looking for a solution for some time, but I haven't found anything. The problem is always the same: The VS internal web server every now and then gives an error saying NO PROTOCOL BINDING MATCHES THE GIVEN ADDRESS '' and the only solution to the problem is to reboot the machine. Changing web.config doesn't work, restarting Visual Studio neither. Any ideas anybody?

Problem with Binding Dictionary to Combo Box Control

Hi All,I am trying to figure out how to bind <Key,Value> pair to Combo Box Control in WPF. By now i have found that the following code do not hold Keys in the comboBox:[vb Code]Dim MyDictionary as Dictionary(OF String,String)MyDictionary.Add("Key1","Value1")MyDictionary.Add("Key2","Value2") ..etc.'***** MyComboBox is ComboBox control ******MyComboBox.ItemSource =  MyDictionary.Values[xmal]<xmls:ComboBox x:Name="MyComboBox" />Doing the above process does not fulfill my purpose of capturing keys. Example if i want to get the "Key" for "selectedItem" then i cannot since i have not binded it.Can anyone suggest me a solution? If anyone can provide me with a xmal and code behind that would be great!!!THanks in Advance.

Query execution plan problem

Hi, I have encountered a problem with a query execution plan on MS SQL Server 2008. It is a simple query on a single table. The table has a primary key RNUM (number(10)) with a clustered index. The query is executed via ODBC using fast forward cursors and is constructed like this: select [field_list_here] from table_name where RNUM>@P and TYPE='A' order by RNUM. The field TYPE has 2 possible values and is not indexed. The table has about 2 000 000 rows of static data (only reads, no inserts and updates). For some time my query executes using the efficient query execution plan. Below a copy from Management Studio from an ad-hoc query: SELECT (0%) <- Clustered Index Seek  (100%) But after 2 days of executing other type of queries SQL Server starts to use other execution plan (live copy):                             Fetch query (0%) <- Clustered Index Seek [CWT_PrimaryKey] (0%)                            |                           \/ Fast forward (0%) <- Population quer

FormView custom data binding problem

Hi there,   I'm using VWD 2010 ASP.NET 4.0 and SQL Server 2008 Also I have login page with the ASP.NET configuration   one of my page has FormView with Update feature   Evryting works fine user login go to my FormView page and update the record.   Now I created a simple function   Protected Function GetUserName() As String        Return User.Identity.Name    End Function   and one of my coloumn call EditedBy   I replaced the Bind("EditedBy") field binding with   Custom binding GetUserName()   When user update it show the current user login name on the screen But it won't show in the table itself (it show null value when i do select statement)   I used to do this with ASP.NET 2.0 with no problem?   How do I fix that?   Thanks, Oded Dror  

GridView column/row data binding problem

Hi All, I have a table with the following structure: Attribute------------- AttributeIdWeekNoDayNoAttribute1Attribute2Attribute3Attribute4Attribute5 ........ likewise. I want to display these data in a gridview in the following manner                                  Sunday    Monday Tuesday ............ (till Saturday) - should be gridview columns, I can retrieve this using dayno Attribute 1 Attribute 2 Attribute 3 Attribute 4 .......... like wise attributes should be taken in to rows.Is this possible in a gridview, if so how can I do that?

Problem binding business objects to custom user control properties

I have created a user control (supplierPicker) intended to allows a supplier database to be searched and a supplier selected. I want to be able to use this control in a number of other user controls, by binding the suppplierID property of the supplierPicker to a supplierID property in a business object, which is set as the datacontext of the parent user control. When I do this, and there is a supplierID specified in the business ofbject, the binding sets the supplierID in the supplierPicker control and it shows the correct supplier name in the textbox. However when the supplierID DependencyProperty is changed from within the supplierPicker the newly selected supplier name is shown in the TextBox, but the SupplierID does not propogate back to the business object. Other controls on the parent form work fine, so the binding to the business object seems to be ok. Any pointers as to what I'm doing wrong here would be grately appreciated.  This one has been driving me nuts for days! Snipped code for the supplier picker:         public partial class SupplierPicker : UserControl, INotifyPropertyChanged     {         public static DependencyProperty SupplierIDProperty;         public event PropertyChangedEventHandler PropertyChan

Problem binding data to DropDownList in DetailsView

Hi guys. I have a slight issue I awas trying to fix for 2-3 days, but nothing I try works. The scenario: DetailsView control in edit mode, I pass parameters to the SqlDataSourceProducts (edit.aspx?id=2) and the data source selects the appropriate data and fills in the DetailsView form. Except two drop down lists. These two DDLs (DDL2 and DDL3) are dependent on the previous DDL (DDL1) in the DetailsView. Thanks to PeteNet, when the selected value of the DDL1 changes, DDL2 and 3 change their lists and get bound to the database. The problem is: when I edit something from the database, DDL2 and 3 appear empty and when I update any other field and leave these, they get blanked in the database.  My goal is to set the selected value of DDL2 and 3 to the values in the database WHERE ID = QueryStringField="id". I can go for not binding the data unless the field is changed, but does not sound professional and user friendly. code: The SqlDataSource used to select the parameters from the table and populate the DetailsView <asp:SqlDataSource ID="SqlDataSourceProduct" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT ID, wm_number, upc, check_digit, unit, price_unit, brand, category, shelves, type, cooking, storage, packaging, origin, nutriti

SQl 2008 execution plan problem

Hi We are in the middle of upgrading a PeopleSoft database from SQL 2000 to SQL 2008. After the upgrade a select from a view takes 8 min compared to the 1 second it took in SQL 2000. I can see that the execution plan is the problem. What is causing 2008 to be worse than 2000. Is there a patch to fix this 2008 problem or should we stick with 2000 for now. Fixing the system with new indexes and trouble shooting the query is out off the quetion as the people lost there faith in SQL as a system and is saying if this happens now it will keep on happening with other dev and to much time is spent on trouble shooting the SQL 2008 shortcomings.

WCF - Java web service interop - Problem with asymmetric binding

Hi, I try to communicate with a Java web service and run into the following error: Error: System.ServiceModel.Security.MessageSecurityException: The incoming message was signed with a token which was different from what used to encrypt the body.  This was not expected. Server stack trace:    at System.ServiceModel.Security.TokenTracker.RecordToken(SecurityToken token)    at System.ServiceModel.Security.ReceiveSecurityHeader.ReadToken(XmlDictionaryReader reader, Int32 position, Byte[] decryptedBuffer, SecurityToken encryptionToken, String idInEncryptedForm, TimeSpan timeout)    at System.ServiceModel.Security.ReceiveSecurityHeader.ExecuteFullPass(XmlDictionaryReader reader)    at System.ServiceModel.Security.StrictModeSecurityHeaderElementInferenceEngine.ExecuteProcessingPasses(ReceiveSecurityHeader securityHeader, XmlDictionaryReader reader)    at System.ServiceModel.Security.ReceiveSecurityHeader.Process(TimeSpan timeout, ChannelBinding channelBinding, ExtendedProtectionPolicy extendedProtectionPolicy)    at System.ServiceModel.Security.MessageSecurityProtocol.ProcessSecurityHeader(ReceiveSecurityHeader securityHeader, Message& message, SecurityToken requiredSigningToken, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)    at System.ServiceModel.Security.AsymmetricSecurity

SQl 2008 execution plan problem

Hi We are in the middle of upgrading a PeopleSoft database from SQL 2000 to SQL 2008. After the upgrade a select from a view takes 8 min compared to the 1 second it took in SQL 2000. I can see that the execution plan is the problem. What is causing 2008 to be worse than 2000. Is there a patch to fix this 2008 problem or should we stick with 2000 for now. Fixing the system with new indexes and trouble shooting the query is out off the quetion as the people lost there faith in SQL as a system and is saying if this happens now it will keep on happening with other dev and to much time is spent on trouble shooting the SQL 2008 shortcomings.

Problem whit ComboBox binding in WPF

Here are my main classes: Configuration { List<Environment > EnvironList, Source ConfigSource } Source { List<FileSource > FileSourceList } FileSource {} inherits class     SourceInfo { string Id, string Source } Environment { List<FileDestination > EnvirFileList } FileDestination { List<String> DestinationList } and inherits class     Info { string SourceId } Info .SourceId refers to SourceInfo .Id. Example: Id="mySource" Source="C:\PathToMyFiles" The Configuration is read from an XML file. In my display, I want to gatter all the SourceInfo objects of my Configuration and put them in a comboBox, to be available for selection in the Environment ->FileDestination ->Info .SourceId. So far, no problem. I also want to select the current value. I did that by putting it at the begining of the list and selecting that index when the list is created. The problem I have is when I try to modify the value. When I change the selection, it shows me the new value, but that value is never saved. If I reload the list, the old value is selected. Also, when I add a new File in the  Environment .EnvirFileList, the SourceId is never added to the XML file. That XML file is create with Serialized properties from my classes. If I remove the ComboBox and use a textbox, the value is added to the XML file. Below is

ListBox object Binding Problem...?


hii guy's

i created a ListBox and i added Engine Class object into it...so i wana display Engine Class property "Name" into ListBox..so plz tell me how can i add property name of "Name" to ListBox of Class "Engine"





ListBox Object Binding Problem..??


hii guy's here i'm having small problem on Object DataBinding using ListBox.. i've a WCF class like..

	public class EngineInstanceStatus 
             public string Name
				return m_name;

so i wana add dis class object to my ListBox.. den it'll display its property name "Name" in ListBox whenever i added this class object ot ListBox..

so plz tell me with sample how can i do this one..



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend