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 7039863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:50:58+00:00 2026-05-28T01:50:58+00:00

I am trying to set the cell style in code but have been unable

  • 0

I am trying to set the cell style in code but have been unable to do so:

xaml:

CellStyle="{StaticResource DefaultCell}"

Which works perfect.

In the code behind I have tired a few variations of:

datagrid.CellStyle = Resources["DefaultCell"] as Style;
datagrid.CellStyle = (Style)FindResource("DefaultCell");

but have been unable to get this to work, any ideas?

  • 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-28T01:50:59+00:00Added an answer on May 28, 2026 at 1:50 am

    If you set the style at hand, it makes sense to define it also at in code (new style, new setter, …) it seems to me you question is rather : “how to get resources from code behind ?”.

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

Sidebar

Related Questions

Ive been trying to push a new view when a cell is tapped but
I'm trying to keep my HTML very simple. I have a set list which
I am trying to set the cell background of my UITableViewCells but I am
I'm trying to set the webkitTransform style attribute, but it's not setting for some
trying to write to work book and change the cell colour using... CellStyle style
I'm trying to set Excel cell colors using Apache POI in Java. I played
I'm trying to set excel's cell name to some custom name and to later
I'm trying to figure out where to properly set tableView.rowHeight. Currently I have it
I'm trying to set array values in UITableViewCell at cellAtRowIndexPath - method, but it's
I am trying to style the following table but I can't avoid styling every

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.