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

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

Auto Binding Constraint doesn't update the UI

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :Windows Application
I needed a way to auto bind an activities inArgument to its parent activities delegateInArguments (property defined in an activity action). Picture dropping a WriteLine activity into an foreach<string> and having the foreach's argument automatically placed into the in argument of the writelines text property - binding it as it is dropped. I have created the constraint, and it works, including changing the binding to the parent or setting the property back to null if not in a parent.  My problem is that the UI doesn't reflect this.  It actually looks like it is doing nothing - I only know it works because it comes back correctly after a save and load of the workflow pattern. I'm guessing that I somehow need to refresh the model item? How do I refresh the model item from within a constraint? If it helps I have included the code for my constraint below, but note that my need is not as simple as the above example, so this does a couple of other things that don't make sense to this question. static Constraint CheckParent() { DelegateInArgument<GetTaskPermissionsActivity> element = new DelegateInArgument<GetTaskPermissionsActivity>(); DelegateInArgument<ValidationContext> context = new DelegateInArgument<ValidationContext>(); Variable<bool> result = new Variable<bool>(); Variable<

View Complete Post

More Related Resource Links

SharePoint Batch Update Auto Increment Field Value


Hello All,

I am making use of SharePoint List Batch Updating methodology in order to update the items in bulk. I build the query dynamically for each and every item using StringBuilder and process the data ultimately using 'ProcessBatchData' Method.

Now, I have a requirement where I have to increment a particular field value in the query while iterating through each item for building the query. How can I auto-increment a field value for each item in the batch query?


Primary Key Constraint Violation on Update

When UPDATING a single column (NOT the primary key column) of a transactionally replicated table, within MS SQL Server Management Studio, the replication monitor gives  Violation of PRIMARY KEY constraint 'PK_my_table. Cannot insert duplicate key in object 'my_table'. Statement Delivery is via the standard SCALL of dbo.sp_MSupd_my_table. The problem correlates with Statement Delivery of DELETE operations. That is, the problem exists if I specify "Do not replicate Delete Statements" and goes away if I specify standard behaviour for delete i.e a call on dbo.sp_MSdel_My_Table dbo.sp_MSupd_my_table does not appear to invoke deletion in any way and Im not updating the primary key value Any ideas Henrietta

Sys.Data.DataContext.saveChanges method doesn't send update to server after DataServiceException ex

Hello,I have a page with a simple form that updates a single record in a table in my database.The database is accessed via WCF Data Services. To load and save data from/to the server, I usethe Sys.Data.DataContext object provided by the ASP.NET AJAX library. When the "save" button on theform is clicked, I use the saveChanges method of the Sys.Data.DataContext object to send all changes to the server.Also, at the server side, I use an interceptor that checks the "Price" fields of the record, and throws a DataServiceException exception when the contents of the field is a negative number.Both the JavaScript and the interceptor (in C#) are copied below.Here is the interesting thing:When I enter a negative price in the form, the interceptor throws the exception and my form shows an error message. Good.However, if I then make one of the other fields in the form a bit shorter (for example from "abcd" to "abc"),the saveChanges method doesn't send the data to the server. But it does call the success callback that I passed in to saveChanges, creating the impressionthat the data has been saved. This happens while the Price field is still negative. I used Fiddler to make sure thatno message is sent to the server. Also, the interceptor doesn't get executed.The weird thing is that if I make one of the fields a bit longer instead (for example &q

binding datetimecontrol,dropdown,textbox inside gridview and update each gridviewrow

i have a web part with datetimecontrol(sharepoint) inside a  gridview. when the page loads this this gridview will be loaded with dtc control and the selecteddate would be one of the columns in the splist.also gridview contaisn dropdowns, textboxes, when an update button cliked inside grid, i need to save the info in the splist.  currently i am not getting the value  bound with dtc control. i am getting blank date inside dtc. though in the  rowdatabound event i amcapturing the values due to some reason i am not able to view the value in the DTCcontrol. can anybody give me help me how to achieve this? any  help links/ sample code.. appreciate the help                         

toolStripStatusLabel.Text doesn't update?

I am able to set the toolStripStatusLabel.Text before showing the Form, but after the Form is shown then changing the status is not possible.I do have tried Application.DoEvents() but didn't help.Am using .Net/VS2005/C#. This works:Application.EnableVisualStyles();Application.SetCompatibleTextRenderingDefault(false);gui = new GUIForm();gui.StatusLabel = "Ready";Application.Run(gui); This doesn't works:Application.EnableVisualStyles();Application.SetCompatibleTextRenderingDefault(false);gui = new GUIForm();Application.Run(gui);gui.StatusLabel = "Ready";Application.DoEvents();

declarative #Bind doesn't bind in update command

I have a bunch of controls like the following in the EditItemTemplate of a ListView, with LINQDataSource:<asp:TextBox ID="Email" CausesValidation="true" EnableViewState="False" Font-Bold="false" Text='<%#Bind("Email")%>' BackColor="#FFFFFF" Enabled="true" TabIndex="50" runat="server" /> I'm curious to know why the database won't update on the click of the Update button:<asp:Button ID="btnUpdate" CommandName="Update" Text="Update" UseSubmitBehavior="False" TabIndex="170" runat="server" /> According to all I've read, the above code should be sufficient. Since CommandName is set to Update, it would seem that no code-behind is necessary.

Update in formview doesn't work, but I don't get an error message?

I have a datasource:<asp:SqlDataSource ID="MySQLProfielDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:WAPMySQLConnStr %>" InsertCommand="INSERT INTO usergegevens(UserId, Geslacht, Voornaam, Tussenvoegsel, Achternaam, Adres, Huisnummer_toev, Postcode, Woonplaats, TelnrV, TelnrM, Geboortedatum) VALUES (@Param1, @Param2, @Param3, @Param4, @Param5, @Param6, @Param7, @Param8, @Param9, @Param10, @Param11, @Param12)" ProviderName="<%$ ConnectionStrings:WAPMySQLConnStr.ProviderName %>" SelectCommand="SELECT UserId, Geslacht, Voornaam, Tussenvoegsel, Achternaam, Adres, Huisnummer_toev, Postcode, Woonplaats, TelnrV, TelnrM, Geboortedatum FROM usergegevens WHERE (UserId = @Param1)" UpdateCommand="UPDATE usergegevens SET Geslacht = @Param1, Voornaam = @Param2, Tussenvoegsel = @Param3, Achternaam = @Param4, Adres = @Param5, Huisnummer_toev = @Param6, Postcode = @Param7, Woonplaats = @Param8, TelnrV = @Param9, TelnrM = @Param10, Geboortedatum = @Param11 WHERE (UserId = @Param12)" onselecting="MySQLProfielDataSource_Selecting" onupdating="MySQLProfielDataSource_Updating" onselected="MySQLProfielDataSource

Why doesn't this update panel work right?

I don't understand why this update panel doesn't work right.   It doesn't do a partial update.  Enable partial page rendering is set to true but clicking the button causes a full page post back.  The text of the label changes with the full post back. So, the event is firing and being handled but not with a partial post back.    This is with in a content page with in a Master Page.Does anyone see what I've done wrong? <asp:ScriptManager ID="MainScriptManager" runat="server" EnablePartialRendering="true"></asp:ScriptManager> <asp:UpdatePanel ID="pnlHelloWorld" runat="server" UpdateMode="Always"> <Triggers> <asp:AsyncPostBackTrigger ControlID="btnHelloWorld" EventName="Click" /> </Triggers> <ContentTemplate> <asp:Label ID="lblHelloWorld" runat="server" Text="Click the button!"></asp:Label> <br /><br /> <asp:Button runat="server" ID="btnHelloWorld" OnClick="btnHelloWorld_Click" Text="Update label!" /> </ContentTemplate> </asp:UpdatePanel> protected void btnHe

Sdf file doesn't update once the application close

     i have configured for data sync setup using configure data synchronization wizard, then deploy the application in emulator. while run the application the data has synched back and forth from client to server on two way sync.  once application get closed the sdf.file is only having  existing data which is same as we got end point of configuration. we can view the updated data while run the application. but we restart application we didn't have the updated and newly inserted data . i don't know what i missed in config. it would be great help if anyone guide me.

Date maskedEdit with watermark doesn't update on invalid date


I'm trying to use the TextBoxWatermarkExtender with MaskedEditExtender/Validator and have found a bug (I think).

In the textbox I enter an invalid date such as 55-55-5555 and exits the textbox. I would then expect the watermark to be shown, but it doesn't. Instead the prompchar is shown (like __-__-____).

If I simply give focus to the textbox and then another control, the watermark is shown.

Is there a workaround such as manually force the TextBoxWatermarkExtender to update.

I'm not the best with javascript, I tried to call focus() and blur() on the textbox in the textbox's onBlur event using window.setTimeout. This works in Firefox, but not IE8, also there has to be a better way I think :-)

            <asp:TextBox ID="TextBox5" runat="server" MaxLength="1" onBlur=""/>
            <asp:ImageButton ID="ImgBntCalc" runat="server" ImageUrl="~/images/Calendar_scheduleHS.png" CausesValidation="False" />

        <ajaxToolkit:TextBoxWatermarkExtender ID="TBWE2" run

Height Doesn't Resize After Update with UpdatePanel in IE



On a page I made, I have a pretty standard update panel. In the update panel are radio buttons that trigger the update panel to change it's view (list or grid) based on which radio is selected. This works great in every browser except IE8. IE8 doesn't seem to want to update the height of the panel when it's refreshed causing the content are to stay rather large or to not be large enough.

You can see it here:


<asp:UpdatePanel ID="uplVideos" ChildrenAsTriggers="true" UpdateMode="Conditional" runat="server">
                    <div id="plVideosControls">
                	    <span style="font-weight: bold; line-height: 26px;">Display Mode:  </span>
                        <asp:RadioButtonList ID="rblVideosDisplay" CssClass="rblVideosDisplay" 

                            <asp:ListItem Text="Table" Value="table" />

Update Parameter doesn't update if Null


I have a vb.net page that has an optional parameter.   If a user enters data for that field, and clicks save, it saves fine via the stored procedure.  HOWEVER, if the user changes their mind, and wants to erase the data they entered, they go to the text field, and delete the characters, and click save, but no matter what, the stored procedure will not save the fact that they erased the data (it won't set it back to NULL).  If the user enters a space, the stored procedure will save the space, and if they enter different data, it will save the other data.  I can't figure out how to get it back to letting them set it to Null?      I think this is because it's an optional parameter, and the stored proc is used by several forms (Some of those forms do not include this parameter), but this form utilizes that optional paramater. 

Here's my stored procedure...

CREATE PROCEDURE [dbo].[123456]
@hdnMatterID int,
@BillingArrangementID int,
@BillingArrangementDetails varchar(200) = NULL,   -----This is the parameter that can't seem to get set back to null if a user changes their mind and tries to erase the stored data...
@BillingFrequencyID int


UPDATE  t123456
SET BillingArrangementID = @BillingArrang

page inside update panel doesn't refresh the session object after postback of any control



I have many controls like dropdown, radiobuttonlist, etc on my page and I put all these controls inside the update panel so that the page doesn't look to be posting back when something is selected. Now the working on the page is very smooth. But the session object isn't getting refreshed even if I postback to the server and as a result even if the users are working on the page they are being sent to the login screen after 20 mins.

Is there anyway where I could put all the controls in update panel and still refresh the session after any postback(dropdown selection)

Any help is greatly appreciated.

Thanks in advance

update master-detail binding with a listbox and textboxes


I have a class, for example FooBar, that is databound to a Window, displaying all kinds of good stuff. It includes an ObservableCollection<Color>, for example shadesOfPink, that displays in a ListBox. This works fine, until I want to bind 3 TextBoxes to the properties ScR, ScG, and ScB of the selected Color. They can display the properties correctly, but when the user changes a value, the Color is not updated in the ListBox until the ListBox is clicked on to change the selection. I want the Color to update as soon as the TextBox loses focus. Is there a way to do this?

I have tried binding the TextBoxes to SelectedItem and binding directly to the properties but nothing worked.

I am using C# 2010.

Auto-Update Managed Metadata Term Store from External DB or List

Hi all,

I have been able to import terms using the .CSV file within the MMSA Term Store, but is there a way to auto-update the terms from an external list. Example: An external database already has terms and adds terms on a regular basis. Is there a method for updating the Term Store automatically when terms are added in the external source. Perhaps creating a SharePoint List populated with external data and somehow linking this up to the Managed Metadata terms? I know that System keywords are added to the term store when a user tags an item, but is there a way to tie into this functionality for managed metadata?

How to connect text file data to native SharePoint lists with auto update?


I have to pull external data from a text file to a SharePoint list on a daily base. Additional column content (e.g. attachments) in SharePoint should be kept during update. There should be RSS feeds, email notifications or workflows on external data change (so delete all items and import new will not work).

I've found this codeless 3rd party solution with automatic background update (and write-back???):

Any other idea? BDC-based? Thanks.

Thanks, SharePointFrank http://www.layer2.de/en/products/

WPF Datagrid binding as a subset of another Binding, does not update on new row



I have created 2 instances of this semi complex senario (similar to my previous post).  To start off, I have a many to many database relationship between 2 tables, so I created a linking table inbetween.  Take a dataset, make 3 tables, create a relationship from one table to another to the other.  So table A is has a many to many relationship to table B via table C (which simply links Aid, to Bid in a bunch of rows).  Take a WPF window, make 2 datagrids, one based on table A, and one based on the relationship table A has to table B.  (bind through the relationship not directly to the source table).  When you select a value in table A, table B's related values appear, and not the whole table B.  Got that far?

Datagrid B, for the relationship, is going to be bizzare...  Make a custom datagrid, add 1 column (a datagridtemplate column).  In the CellEditingTemplate, add a single combobox, with ALL of Table B as an ItemsSource. (we now should have 4 CollectionViewSources, All of Table A, Related A to C, Related C to B, All of Table B).  This can be done simply by using the DataSource window and opening table A, then open table C (inside of table A), then open table B (inside of table C, inside of table A), then drag table B into the window.  WPF will create all

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