Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6374475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:29:34+00:00 2026-05-25T01:29:34+00:00

I have A problem regarding Converting Xaml to C# , I m using Auto

  • 0

I have A problem regarding Converting Xaml to C# , I m using Auto complete Box Tab order is not working Properly On that Means First we move all the control and at last I goes on Auto complete Box i m solving this through the xaml code

<ToolKit:AutoCompleteBox.TextBoxStyle>
    <Style TargetType="TextBox">
        <Setter Property="TabIndex"
                Value="{Binding ElementName=txtFirstName, Path=TabIndex}"/>
    </Style>
</ToolKit:AutoCompleteBox.TextBoxStyle>

Now on Another i m using All Control Dynamic so no Xaml there For Auto complete My All Works Is to be Complete But i m Facing Same Tab order problem How Can I convert Above Xaml Code From C#

ctrl = new AutoCompleteBox { FontSize = 14, MaxDropDownHeight = 90 };
//Here We need to Implement That Style
ctrl.TabIndex = c.TabOrder;
ctrl.MaxWidth = 200;
if (c.SpName != null && c.DisplayMember != null)
{
    DataTable dt = sqlHelper.ExecuteSelectProcedure(c.SpName);
    var cmb = ctrl as AutoCompleteBox;
    cmb.ItemsSource = dt.AsEnumerable().Select(r => r.Field<string>(c.DisplayMember)).ToList();
}

Please Help Me out Thanks And Regards

Shashank Tyagi

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:29:36+00:00Added an answer on May 25, 2026 at 1:29 am
    else if (c.Type == typeof(AutoCompleteBox))
    {
        //var style = new Style(typeof(TextBox));
        ctrl = new AutoCompleteBox { FontSize = 14, MaxDropDownHeight = 90, Name = c.ControlID };
        ctrl.TabIndex = c.TabOrder;
        ctrl.MaxWidth = 200;
    
        var style = new Style(typeof(TextBox));
        var binding = new Binding("TabIndex") { ElementName = c.ControlID };
        var setter = new Setter(TextBox.TabIndexProperty, binding);
        style.Setters.Add(setter);
        (ctrl as AutoCompleteBox).TextBoxStyle = style;
    
        if (c.SpName != null && c.DisplayMember != null)
        {
            DataTable dt = sqlHelper.ExecuteSelectProcedure(c.SpName);
            var cmb = ctrl as AutoCompleteBox;
            cmb.ItemsSource = dt.AsEnumerable().Select(r => r.Field<string>(c.DisplayMember)).ToList();
        }
    }
    

    This Code Perfectly works

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem regarding StartUp Url in WPF. I have a LoginView.xaml and
I have some problem regarding converting/truncating a number. This is the condition: x.35 where
I have an accuracy problem with a reporting tool that I'm using. The issue
I have a problem regarding getting the path of a user control. The scenario
I have a problem regarding the datediff MYSQL function, I can use it and
I have a question regarding a problem with L2S, Autogenerated DataContext and the use
I actually have two questions regarding the same problem but I think it is
I have problem in some JavaScript that I am writing where the Switch statement
I'm currently working on a project Euler problem (www.projecteuler.net) for fun but have hit
So I know there have been multiple questions regarding Money and converting to and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.