Forum
smartDBforms.NET for ASP.NET 2
 
 
Knowledge Base Forum
To post messages on the forum, you need to login first.
SearchForum Home
  Product Forums  smartDBforms.NET  How to set valu...
 How to set value for insert screen?
 
 6/20/2007 5:31:57 AM
Rudi
2 posts


How to set value for insert screen?
Is it possible to set initial value for insert screen. I want department textbox do be preinited  when insert screen is shown.
 6/20/2007 10:34:02 AM
Adillis Support
27 posts
adillis.com


Re: How to set value for insert screen?

Hi Rudi,

You can specify a default display insert value for the desired column in the SmartDataSource control Insert parameters. In Design mode open the editor for the SmartDataSource Insert query, select the desired parameter in the Parameters list and fill in the DefaultValue field.

If you have any other questions, we will be more than happy to help you.
Best wishes,
Adillis Support
Adillis - IT solutions http://adillis.com

 6/21/2007 4:12:46 AM
Rudi
2 posts


Re: How to set value for insert screen?
Thank you,
But now the insert value isalways the same. I need different values for different logged on users. Is this possible?
 6/22/2007 2:54:37 PM
Adillis Support
27 posts
adillis.com


Re: How to set value for insert screen?
Hi Rudi,

You can dynamically change the initial display insert values by handling the SmartDBView.DataBindingChildren event. During this event when the current mode is Insert the DataItem holds the DataRow that will be used for data binding the Insert user interface.
Short Example:

   protected void SmartDBView1_DataBindingChildren(SmartDBView sender, EventArgs e)
{
System.Data.DataRowView row = sender.DataItem as System.Data.DataRowView;
if (sender.CurrentMode == SmartDBViewMode.Insert
&& row != null)
{
row["ProductName"] = "Product" + (new Random()).Next();
}
}

If you have any other questions, we will be more than happy to help you.
Best wishes,
Adillis Support
Adillis - IT solutions http://adillis.com
  Product Forums  smartDBforms.NET  How to set valu...
Copyright 2006-2008 Adillis Terms Of Use Feedback Contact Us